Documentos de Académico
Documentos de Profesional
Documentos de Cultura
.\RunSQL_SQL_Walkthrough.ps1
2. As part of this step, all the TransactSQL scripts are also modified to replace placeholders with the database name and
user name that you provide as script inputs.
Take a minute to review the stored procedures and functions created by the script.
SQL script
file name
Function
createdbtb
upload
data.sql
fnCalculateDi
stance.sql
Creates a scalarvalued function that calculates the direct distance between pickup and dropoff
locations
fnEngineerFe
atures.sql
Creates a tablevalued function that creates new data features for model training
PersistModel.
sql
Creates a stored procedure that can be called to save a model. The stored procedure takes a model
that has been serialized in a varbinary data type, and writes it to the specified table.
PredictTipBat
chMode.sql
Creates a stored procedure that calls the trained model to create predictions using the model. The
stored procedure accepts a query as its input parameter and returns a column of numeric values
containing the scores for the input rows.
PredictTipSin
gleMode.sql
Creates a stored procedure that calls the trained model to create predictions using the model. This
stored procedure accepts a new observation as input, with individual feature values passed as inline
parameters, and returns a value that predicts the outcome for the new observation.
You'll create some additional stored procedures in the latter part of this walkthrough:
SQL script
file name
Function
PlotHistogra
m.sql
Creates a stored procedure for data exploration. This stored procedure calls an R function to plot the
histogram of a variable and then returns the plot as a binary object.
PlotInOutput
Files.sql
Creates a stored procedure for data exploration. This stored procedure creates a graphic using an R
function and then saves the output as a local PDF file.
TrainTipPredi
ctionModel.s
ql
Creates a stored procedure that trains a logistic regression model by calling an R package. The model
predicts the value of the tipped column, and is trained using a randomly selected 70% of the data.
The output of the stored procedure is the trained model, which is saved in the table nyc_taxi_models.
3. Log in to the SQL Server instance using SQL Server Management Studio and the login you specified, to verify that you can
see the database, tables, functions, and stored procedures that were created.
Note
Next Step
Previous Step
Step 1: Download the Sample Data
See Also
InDatabase Advanced Analytics for SQL Developers Tutorial
SQL Server R Services Tutorials
2016 Microsoft