Skip to content

Commit ecf37e6

Browse files
authored
Merge pull request #216 from NelGson/master
Readme update - Python
2 parents 2109980 + 003979d commit ecf37e6

File tree

2 files changed

+21
-7
lines changed
  • samples/features/machine-learning-services/python/getting-started/rental-prediction

2 files changed

+21
-7
lines changed

samples/features/machine-learning-services/python/getting-started/rental-prediction/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Build a predictive model with Python using SQL Server 2017 Machine Learning Services
22

3-
This sample shows how to create a predictive model in Python and operationalize it with SQL Server vNext.
3+
This sample shows how to create a predictive model in Python and operationalize it with SQL Server 2017
44

55
### Contents
66

77
[About this sample](#about-this-sample)<br/>
88
[Before you begin](#before-you-begin)<br/>
99
[Sample details](#sample-details)<br/>
10-
[Related links](#related-links)<br/>
10+
1111

1212

1313
<a name=about-this-sample></a>
@@ -41,17 +41,17 @@ Download a DB backup file and restore it using Setup.sql. [Download DB](https://
4141
<!-- Examples -->
4242
1. SQL Server 2017 CTP2.0 (or higher) with Machine Learning Services (Python) installed
4343
2. SQL Server Management Studio
44-
3. Python Tools for Visual Studio
44+
3. Python Tools for Visual Studio or another Python IDE
4545

4646
## Run this sample
4747
1. From SQL Server Management Studio or SQL Server Data Tools connect to your SQL Server vNext database and execute setup.sql to restore the sample DB you have downloaded </br>
48-
2. From SQL Server Management Studio or SQL Server Data Tools, open the Predictive Model Python.sql script </br>
48+
2. From SQL Server Management Studio or SQL Server Data Tools, open the rental_prediction.sql script </br>
4949
This script sets up: </br>
5050
Necessary tables </br>
5151
Creates stored procedure to train a model </br>
5252
Creates a stored procedure to predict using that model </br>
5353
Saves the predicted results to a DB table </br>
54-
3. You can also try the python script on its own. Just remember to point the Python environment to the corresponding path "C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\PYTHON_SERVICES" if you run in-db Python Server, or
54+
3. You can also try the Python script on its own, connecting to SQL Server and getting data using RevoScalePy Rx functions. Just remember to point the Python environment to the corresponding path "C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\PYTHON_SERVICES" if you run in-db Python Server, or
5555
"C:\Program Files\Microsoft SQL Server\140\PYTHON_SERVER" if you have the standalone Machine Learning Server installed.
5656

5757
<a name=sample-details></a>
@@ -64,9 +64,10 @@ This sample shows how to create a predictive model with Python and generate pred
6464
The Python script that generates a predictive model and uses it to predict rental counts
6565

6666
### rental_prediction.sql
67-
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.
68-
67+
Takes the Python code in rental_prediction.py and deploys it inside SQL Server. Creating stored procedures and tables for training, storing models and creating stored procedures for prediction.
6968

69+
### setup.sql
70+
Restores the sample DB (Make sure to update the path to the .bak file)
7071

7172

7273

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- Before we start, we need to restore the DB for this tutorial.
2+
-- Step1: Download the compressed backup file (https://deve2e.azureedge.net/sqlchoice/static/TutorialDB.bak)
3+
--Save the file on a location where SQL Server can access it. For example: C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Backup\
4+
-- In a new query window in SSMS, execute the following restore statement, but REMEMBER TO CHANGE THE FILE PATHS
5+
-- to match the directories of your installation!
6+
USE master;
7+
GO
8+
RESTORE DATABASE TutorialDB
9+
FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Backup\TutorialDB.bak'
10+
WITH
11+
MOVE 'TutorialDB' TO 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\TutorialDB.mdf'
12+
,MOVE 'TutorialDB_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\TutorialDB.ldf';
13+
GO

0 commit comments

Comments
 (0)