renamed folders, renamed python tutorial files, updated readme files
@@ -60,10 +60,10 @@ Saves the predicted results to a DB table </br>
|
||||
|
||||
This sample shows how to create a predictive model with Python and generate predictions using the model and deploy that in SQL Server with SQL Server Machine Learning Services.
|
||||
|
||||
### predictive_model.py
|
||||
### rental_prediction.py
|
||||
The Python script that generates a predictive model and uses it to predict rental counts
|
||||
|
||||
### predictive_model_python.sql
|
||||
### rental_prediction.sql
|
||||
Takes the Python code in Predictive Model.py and deploys it inside SQL Server. Creating stored procedures and tables for training, storing models and creating stored procedures for prediction.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ from revoscalepy.etl.RxImport import rx_import_datasource
|
||||
|
||||
|
||||
def get_rental_predictions():
|
||||
conn_str = 'Driver=SQL Server;Server=NELLIELAPTOP\\SQLSERVER20;Database=TutorialDB;Trusted_Connection=True;'
|
||||
conn_str = 'Driver=SQL Server;Server=MYSQLSERVER;Database=TutorialDB;Trusted_Connection=True;'
|
||||
column_info = {
|
||||
"Year" : { "type" : "integer" },
|
||||
"Month" : { "type" : "integer" },
|
||||
@@ -26,9 +26,8 @@ BEGIN
|
||||
EXECUTE sp_execute_external_script
|
||||
@language = N'Python'
|
||||
, @script = N'
|
||||
import pandas as pd
|
||||
df = pd.DataFrame(rental_train_data)
|
||||
print(df)
|
||||
|
||||
df = rental_train_data
|
||||
|
||||
# Get all the columns from the dataframe.
|
||||
columns = df.columns.tolist()
|
||||
@@ -84,8 +83,8 @@ BEGIN
|
||||
import pickle
|
||||
rental_model = pickle.loads(py_model)
|
||||
|
||||
import pandas as pd
|
||||
df = pd.DataFrame(rental_score_data)
|
||||
|
||||
df = rental_score_data
|
||||
#print(df)
|
||||
|
||||
# Get all the columns from the dataframe.
|
||||
@@ -1,8 +1,6 @@
|
||||
# Samples for SQL Server R Services
|
||||
# Samples for SQL Server Machine Learning Services
|
||||
|
||||
|
||||
Go to the getting started tutorials to learn more about:
|
||||
[Predictive Modeling with R Services](https://www.microsoft.com/en-us/sql-server/developer-get-started/rprediction)
|
||||
[Customer Clustering with R Services](https://www.microsoft.com/en-us/sql-server/developer-get-started/rclustering)
|
||||
|
||||
[Telco Customer Churn](Telco Customer Churn)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
##################### STEP1 - Connect to DB and read data ####################
|
||||
|
||||
#Connection string to connect to SQL Server named instance
|
||||
connStr <- paste("Driver=SQL Server; Server=", "NELLIELAPTOP\\VNEXTCTP14",
|
||||
connStr <- paste("Driver=SQL Server; Server=", "MYSQLSERVER",
|
||||
";Database=", "Tutorialdb", ";Trusted_Connection=true;", sep = "");
|
||||
|
||||
#Get the data from SQL Server Table
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 894 B After Width: | Height: | Size: 894 B |
|
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 160 B |
|
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 148 B |
|
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
|
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 158 B |
|
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 146 B |