You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced-analytics/known-issues-for-sql-server-machine-learning-services.md
+2-7Lines changed: 2 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: "Known issues in Machine Learning Services | Microsoft Docs"
3
3
ms.custom:
4
4
- "SQL2016_New_Updated"
5
-
ms.date: "09/13/2017"
5
+
ms.date: "09/19/2017"
6
6
ms.prod: "sql-server-2016"
7
7
ms.reviewer: ""
8
8
ms.suite: ""
@@ -303,15 +303,10 @@ For compatibility with [!INCLUDE[rsql_productname](../includes/rsql-productname-
303
303
304
304
Revision 0.92 of the SQLite ODBC driver is incompatible with RevoScaleR. Revisions 0.88-0.91 and 0.93 and later are known to be compatible.
305
305
306
-
## Python code execution or package issues
306
+
## Python code execution or Python package issues
307
307
308
308
This section contains known issues that are specific to running Python on SQL Server, as well as issues that are related to the Python packages published by Microsoft, including [revoscalepy](https://docs.microsoft.com/r-server/python-reference/revoscalepy/revoscalepy-package) and [microsoftml](https://docs.microsoft.com/r-server/python-reference/microsoftml/microsoftml-package).
309
309
310
-
### Content of varbinary(max) data type is truncated when passed to Python
311
-
312
-
If you are using Python script in the CTP 2.0 release of SQL Server 2017, and pass data such as images using the varbinary(max) data type, the data might be truncated.
313
-
314
-
The reason is that early preview releases did not provide the correct mapping of the SQL varbinary(max) data type to the Python byte data type. This issue is fixed in the RTM version. We recommend that you upgrade as soon as possible.
Copy file name to clipboardExpand all lines: docs/advanced-analytics/sql-native-scoring.md
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
---
2
2
title: "Native scoring| Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "07/16/2017"
5
-
ms.prod: "sql-server-2016"
4
+
ms.date: "09/19/2017"
5
+
ms.prod: "sql-server-2017"
6
6
ms.reviewer: ""
7
7
ms.suite: ""
8
8
ms.technology:
@@ -34,9 +34,10 @@ To support fast scoring, SQL Server Machine Learning Services (and Microsoft Mac
34
34
35
35
**Native scoring**
36
36
37
-
+ The PREDICT function in Transact-SQL can be used for _native scoring_ from any instance of SQL Server 2017. It requires only that you have a model already trained and saved in a table or can be called via T-SQL. It is a kind of realtime scoring that uses native T-SQL functions; no additional configuration required.
37
+
+ The PREDICT function in Transact-SQL can be used for _native scoring_ from any instance of SQL Server 2017. It requires only that you have a model already trained and saved in a table or can be called via T-SQL. It is a kind of realtime scoring that uses native T-SQL functions, with these advantages:
38
38
39
-
The R runtime is not called and does not need to be installed.
39
+
+ No additional configuration is required.
40
+
+ The R runtime is not called and does not need to be installed.
40
41
41
42
**Realtime scoring**
42
43
@@ -65,6 +66,11 @@ For code samples, along with instructions on how to prepare the models in the re
65
66
66
67
+[How to perform realtime scoring](r/how-to-do-realtime-scoring.md)
67
68
69
+
For a complete solution that includes native scoring, see these samples from the SQL Server development team:
70
+
71
+
+ Deploy your ML script: [Using a Python model](https://microsoft.github.io/sql-ml-tutorials/python/rentalprediction/step/3.html)
72
+
+ Deploy your ML script: [Using an R model](https://microsoft.github.io/sql-ml-tutorials/R/rentalprediction/step/3.html)
Copy file name to clipboardExpand all lines: docs/advanced-analytics/tutorials/run-python-using-t-sql.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
---
2
2
title: "Run Python using T-SQL | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "07/31/2017"
5
-
ms.prod: "sql-server-2016"
4
+
ms.date: "09/19/2017"
5
+
ms.prod: "sql-server-2017"
6
6
ms.reviewer: ""
7
7
ms.suite: ""
8
8
ms.technology:
@@ -121,7 +121,7 @@ GO
121
121
122
122
## Step 3. View the results
123
123
124
-
The stored procedure returns the original data, applies the script, and then returns the modified data in the **Results** pane of Management Studio or other SQL query tool.
124
+
The stored procedure gets the original data, applies the Python script, and then returns the modified data in the **Results** pane of Management Studio or other SQL query tool.
125
125
126
126
127
127
|DayOfWeek (before)| Amount|DayOfWeek (after) |
@@ -167,7 +167,9 @@ ParamINT=2
167
167
ParamCharN=OUTPUT
168
168
```
169
169
170
-
+ The Message output includes the working directory used for script execution. In this example, MSSQLSERVER01 refers to the worker account allocated by SQL Server to manage the job. The GUID is the name of a temporary folder that is created during script execution to store data and script artifacts. These temporary folders are secured by SQL Server, and are cleaned up by the Windows job object after script has terminated.
170
+
+ The **Message** output includes the working directory used for script execution. In this example, MSSQLSERVER01 refers to the worker account allocated by SQL Server to manage the job.
171
+
172
+
The GUID is the name of a temporary folder that is created during script execution to store data and script artifacts. These temporary folders are secured by SQL Server, and are cleaned up by the Windows job object after script has terminated.
171
173
172
174
+ The section containing the message "Hello World" prints two times. This happens because the value of *@RowsPerRead* was set to 5 and there are 10 rows in the table; therefore, two calls to Python are required to process all the rows in the table.
173
175
@@ -178,9 +180,9 @@ ParamCharN=OUTPUT
178
180
See these additional Python samples and tutorials for advanced tips and end-to-end demos.
179
181
180
182
+[Use Python revoscalepy to create a model](use-python-revoscalepy-to-create-model.md)
181
-
+[In-Database Python for SQL Developers](sqldev-in-database-python-for-sql-developers.md)
183
+
+[In-Database Python for SQL developers](sqldev-in-database-python-for-sql-developers.md)
182
184
+[Build a predictive model using Python and SQL Server](https://microsoft.github.io/sql-ml-tutorials/python/rentalprediction/)
183
185
184
186
## Troubleshooting
185
187
186
-
If you can't find the stored procedure, `sp_execute_external_script`, it means you probably haven't finished configuring the instance to support external runtimes. After running SQL Server 2017 setup and selecting Python as the machine learning language, you must also explicitly enable the feature using `sp_configure`, and then restart the instance. For details, see [Setup Machine Learning Services with Python](../python/setup-python-machine-learning-services.md).
188
+
If you can't find the stored procedure, `sp_execute_external_script`, it means you probably haven't finished configuring the instance to support external script execution. After running SQL Server 2017 setup and selecting Python as the machine learning language, you must also explicitly enable the feature using `sp_configure`, and then restart the instance. For details, see [Setup Machine Learning Services with Python](../python/setup-python-machine-learning-services.md).
Copy file name to clipboardExpand all lines: docs/advanced-analytics/tutorials/sql-server-python-tutorials.md
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: "SQL Server Python tutorials | Microsoft Docs"
3
3
ms.custom:
4
4
- "SQL2016_New_Updated"
5
-
ms.date: "08/29/2017"
5
+
ms.date: "09/19/2017"
6
6
ms.prod: "sql-server-2017"
7
7
ms.reviewer: ""
8
8
ms.suite: ""
@@ -41,10 +41,6 @@ For information about requirements and setup, see [Prerequisites](#bkmk_Prerequi
41
41
42
42
You'll create a model using **rxLinMod**, from the new **revoscalepy** library. You'll launch the code from a remote Python terminal but the modeling will take place in the SQL Server compute context.
43
43
44
-
+[Build a predictive model with Python (GitHub)](https://github.com/Microsoft/sql-server-samples/tree/master/samples/features/machine-learning-services/python/getting-started/rental-prediction)
45
-
46
-
Create a machine learning model to predict demand for a ski rental business, and operationalize that model for day-to-day demand prediction using stored procedures. All code and data is provided.
47
-
48
44
+[In-Database Python analytics for SQL developers](sqldev-in-database-python-for-sql-developers.md)
49
45
50
46
NEW! Build a complete Python solution using T-SQL stored procedures. All Python code is included.
@@ -61,7 +57,10 @@ These samples and demos provided by the SQL Server development team highlight wa
61
57
62
58
Learn how a ski rental business might use machine learning to predict future rentals, which helps the business plan and staff to meet future demand.
63
59
64
-
+[NEW! Perform customer clustering using Python and SQL Server](https://microsoft.github.io/sql-ml-tutorials/python/customerclustering/)
60
+
> [!TIP]
61
+
> Now includes native scoring from Python models!
62
+
63
+
+[Perform customer clustering using Python and SQL Server](https://microsoft.github.io/sql-ml-tutorials/python/customerclustering/)
65
64
66
65
Learn how to use the Kmeans algorithm to perform unsupervised clustering of customers.
67
66
@@ -77,13 +76,13 @@ To use these tutorials, you must have installed SQL Server 2017 Machine Learning
77
76
78
77
After running SQL Server setup, don't forget these important steps:
79
78
80
-
+ Enable the external script execution feature by running `sp_configure 'external scripts enabled', 1`
81
-
+ Restart the server
82
-
+ Ensure that the service that calls the external runtime has necessary permissions
83
-
+ Ensure that your SQL login or Windows user account has necessary permissions to connect to the server, to read data, and to create any database objects required by the sample
79
+
+ Enable the external script execution feature by running `sp_configure 'external scripts enabled', 1`.
80
+
+ Restart the server.
81
+
+ Ensure that the service that calls the external runtime has necessary permissions.
82
+
+ Ensure that your SQL login or Windows user account has necessary permissions to connect to the server, to read data, and to create any database objects required by the sample.
84
83
85
84
If you run into trouble, see this article for some common issues: [Troubleshooting Machine Learning Services](../machine-learning-troubleshooting-faq.md)
86
85
87
-
## See Also
86
+
## See also
88
87
89
88
[R tutorials for SQL Server](sql-server-r-tutorials.md)
Copy file name to clipboardExpand all lines: docs/advanced-analytics/tutorials/use-python-revoscalepy-to-create-model.md
+11-14Lines changed: 11 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
title: "Use Python with revoscalepy to Create a Model| Microsoft Docs"
3
3
ms.custom:
4
4
- "SQL2016_New_Updated"
5
-
ms.date: "07/03/2017"
6
-
ms.prod: "sql-server-2016"
5
+
ms.date: "09/19/2017"
6
+
ms.prod: "sql-server-2017"
7
7
ms.reviewer: ""
8
8
ms.suite: ""
9
9
ms.technology:
@@ -17,11 +17,11 @@ manager: "jhubbard"
17
17
---
18
18
# Use Python with revoscalepy to create a model
19
19
20
-
This example demonstrates how you can create a logistic regression model in SQL Server, using an algorithm from the **revoscalepy** package.
20
+
This example demonstrates how you can create a linear regression model in SQL Server, using an algorithm from the **revoscalepy** package.
21
21
22
22
The **revoscalepy** package for Python contains objects, transformations, and algorithms similar to those provided for the **RevoScaleR** package for the R language. With this library, you can create a compute context, move data between compute contexts, transform data, and train predictive models using popular algorithms such as logistic and linear regression, decision trees, and more.
23
23
24
-
For more information, see [What is revoscalepy?](../python/what-is-revoscalepy.md)
24
+
For more information, see [What is revoscalepy?](../python/what-is-revoscalepy.md) and the [Python function reference](https://docs.microsoft.com/r-server/python-reference/introducing-python-package-reference)
25
25
26
26
## Prerequisites
27
27
@@ -108,8 +108,8 @@ Let's review the code and highlight some key steps.
108
108
109
109
A data source is different from a compute context. The _data source_ defines the data used in your code. The _compute context_ defines where the code will be executed.
110
110
111
-
1. Create Python variables, such as `sql_query` and `sql_connection_string`, that define the source and the data you want to use. Pass these variables to the RxSqlServerData constructor to implement the **data source object** named `data_source`.
112
-
2. Create a compute context object by using the **RxInSqlServer** constructor. In this example, you pass the same connection string you defined earlier, on the assumption that the data is on the same SQL Server instance that you will be using as the compute context. However, the data source and the compute context could be on different servers. The resulting **compute context object** is named `sql_cc`.
111
+
1. Create Python variables, such as `sql_query` and `sql_connection_string`, that define the source and the data you want to use. Pass these variables to the [RxSqlServerData](https://docs.microsoft.com/r-server/python-reference/revoscalepy/rxsqlserverdata) constructor to implement the **data source object** named `data_source`.
112
+
2. Create a compute context object by using the [RxInSqlServer](https://docs.microsoft.com/r-server/python-reference/revoscalepy/rxinsqlserverdata) constructor. In this example, you pass the same connection string you defined earlier, on the assumption that the data is on the same SQL Server instance that you will be using as the compute context. However, the data source and the compute context could be on different servers. The resulting **compute context object** is named `sql_cc`.
113
113
3. Choose the active compute context. By default, operations are run locally, which means that if you don't specify a different compute context, the data will be fetched from the data source, and the model-fitting will run in your current Python environment.
114
114
115
115
### Changing compute contexts
@@ -122,23 +122,20 @@ The same applies in the call to **rxsummary**, where the compute context is reus
You can also use the function **rxsetcomputecontext** to toggle between compute contexts that have already been defined.
125
+
You can also use the function [rx_set_computecontext](https://docs.microsoft.com/r-server/python-reference/revoscalepy/rx-set-compute-context) to toggle between compute contexts that have already been defined.
126
126
127
127
### Setting the degree of parallelism
128
128
129
-
When you define the compute context, you can also set parameters that control how the data is handled by the compute context. These parameters differ depending on the data source type.
129
+
When you define the compute context, you can also set parameters that control how the data is handled by the compute context. These parameters differ depending on the data source type.
130
130
131
131
For SQL Server compute contexts, you can set the batch size, or provide hints about the degree of parallelism to use in running tasks.
132
132
133
-
The sample was run on a computer with four processors, so we set the *num_tasks* parameter to 4. If you set this value to 0, SQL Server uses the default, which is to run as many tasks in parallel as possible, under the current MAXDOP settings for the server.
134
-
However, even in servers with many processors, the exact number of tasks that might be allocated depends on many other factors, such as server settings, and other jobs that are running.
135
-
136
-
For more information, see [RxInSqlServer](https://docs.microsoft.com/r-server/r-reference/revoscaler/rxinsqlserver).
133
+
The sample was run on a computer with four processors, so we set the *num_tasks* parameter to 4. If you set this value to 0, SQL Server uses the default, which is to run as many tasks in parallel as possible, under the current MAXDOP settings for the server.However, even in servers with many processors, the exact number of tasks that might be allocated depends on many other factors, such as server settings, and other jobs that are running.
137
134
138
135
## Related samples
139
136
140
137
See these Python samples and tutorials for advanced tips and end-to-end demos.
141
138
142
-
+[In-Database Python for SQL Developers](sqldev-in-database-python-for-sql-developers.md)
139
+
+[In-Database Python for SQL developers](sqldev-in-database-python-for-sql-developers.md)
143
140
+[Build a predictive model using Python and SQL Server](https://microsoft.github.io/sql-ml-tutorials/python/rentalprediction/)
144
-
+[Deploy and Consume Python Models](../python/publish-consume-python-code.md)
141
+
+[Deploy and consume Python Models](../python/publish-consume-python-code.md)
0 commit comments