Skip to content

Commit 461c68b

Browse files
authored
Merge pull request #6847 from MicrosoftDocs/master
8/15 PM Publish
2 parents dbb96d7 + 6b11e71 commit 461c68b

10 files changed

Lines changed: 162 additions & 189 deletions

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"redirect_url": "https://docs.microsoft.com/sql/advanced-analytics/install/sql-pretrained-models-install",
1111
"redirect_document_id": false
1212
},
13+
{
14+
"source_path": "docs/advanced-analytics/r/sqldev-import-data-to-sql-server-using-powershell.md",
15+
"redirect_url": "https://docs.microsoft.com/sql/advanced-analytics/tutorials/sqldev-download-the-sample-data",
16+
"redirect_document_id": false
17+
},
1318
{
1419
"source_path": "docs/advanced-analytics/tutorials/walkthrough-prerequisites-for-data-science-walkthroughs.md",
1520
"redirect_url": "https://docs.microsoft.com/sql/advanced-analytics/tutorials/walkthrough-data-science-end-to-end-walkthrough",

docs/advanced-analytics/r/sqldev-import-data-to-sql-server-using-powershell.md

Lines changed: 0 additions & 90 deletions
This file was deleted.
Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
---
2-
title: Realtime scoring | Microsoft Docs
2+
title: Real-time scoring in SQL Server machine learning | Microsoft Docs
33
ms.prod: sql
44
ms.technology: machine-learning
55

6-
ms.date: 04/15/2018
6+
ms.date: 08/15/2018
77
ms.topic: conceptual
88
author: HeidiSteen
99
ms.author: heidist
1010
manager: cgronlun
1111
---
1212

13-
# Realtime scoring
13+
# Real-time scoring in SQL Server machine learning
1414
[!INCLUDE[appliesto-ss-xxxx-xxxx-xxx-md-winonly](../includes/appliesto-ss-xxxx-xxxx-xxx-md-winonly.md)]
1515

16-
This topic describes a feature available in SQL Server 2016 and SQL Server 2017 that supports scoring on machine learning models in near realtime.
16+
This article describes a feature available in SQL Server 2016 R Services and SQL Server 2017 Machine Learning Services that supports scoring on machine learning models in near real time.
1717

1818
> [!TIP]
19-
> Native scoring is a special implementation of realtime scoring that uses the native T-SQL PREDICT function for very fast scoring, and is available only in SQL Server 2017. For more information, see [Native scoring](sql-native-scoring.md).
19+
> Native scoring is a special implementation of real-time scoring that uses the native T-SQL PREDICT function for very fast scoring, and is available only in SQL Server 2017 Machine Learning Services. For more information, see [Native scoring](sql-native-scoring.md).
2020
21-
## How realtime scoring works
21+
## How real-time scoring works
2222

23-
Realtime scoring is supported in both SQL Server 2017 and SQL Server 2016, on specific model types created by using supproted RevoScaleR or MicrosoftML algorithms. It uses native C++ libraries to generate scores, based on user input provided to a machine learning model stored in a special binary format.
23+
Real-time scoring is supported in both SQL Server 2017 and SQL Server 2016, on specific model types based on RevoScaleR or MicrosoftML functions such as [rxLinMod (RevoScaleR)](https://docs.microsoft.com/machine-learning-server/r-reference/revoscaler/rxlinmod)[rxNeuralNet (MicrosoftML)](https://docs.microsoft.com/machine-learning-server/r-reference/microsoftml/rxneuralnet). It uses native C++ libraries to generate scores, based on user input provided to a machine learning model stored in a special binary format.
2424

2525
Because a trained model can be used for scoring without having to call an external language runtime, the overhead of multiple processes is reduced. This supports much faster prediction performance for production scoring scenarios. Because the data never leaves SQL Server, results can be generated and inserted into a new table without any data translation between R and SQL.
2626

27-
Realtime scoring is a multi-step process:
27+
Real-time scoring is a multi-step process:
2828

2929
1. The stored procedure that does scoring must be enabled on a per-database basis.
3030
2. You load the pre-trained model in binary format.
@@ -33,40 +33,39 @@ Realtime scoring is a multi-step process:
3333

3434
## Get started
3535

36-
For code examples and instructions, see [How to perform native scoring or realtime scoring](r/how-to-do-realtime-scoring.md).
36+
For code examples and instructions, see [How to perform native scoring or real-time scoring](r/how-to-do-realtime-scoring.md).
3737

38-
For an example of how rxPredict can used for scoring, see [End to End Loan ChargeOff Prediction Built Using Azure HDInsight Spark Clusters and SQL Server 2016 R Service](https://blogs.msdn.microsoft.com/rserver/2017/06/29/end-to-end-loan-chargeoff-prediction-built-using-azure-hdinsight-spark-clusters-and-sql-server-2016-r-service/)
38+
For an example of how rxPredict can be used for scoring, see [End to End Loan ChargeOff Prediction Built Using Azure HDInsight Spark Clusters and SQL Server 2016 R Service](https://blogs.msdn.microsoft.com/rserver/2017/06/29/end-to-end-loan-chargeoff-prediction-built-using-azure-hdinsight-spark-clusters-and-sql-server-2016-r-service/)
3939

4040
> [!TIP]
4141
> If you are working exclusively in R code, you can also use the [rxPredict](https://docs.microsoft.com/r-server/r-reference/revoscaler/rxpredict) function for fast scoring.
4242
4343
## Requirements
4444

45-
Realtime scoring is supported on these platforms:
45+
Real-time scoring is supported on these platforms:
4646

4747
+ SQL Server 2017 Machine Learning Services
48-
+ SQL Server R Services 2016, with an upgrade of the R Services instance to Microsoft R Server 9.1.0 or later
49-
+ Machine Learning Server (Standalone)
48+
+ SQL Server R Services 2016, with an upgrade of R components to 9.1.0 or later
5049

51-
On SQL Server, you must enable the realtime scoring feature in advance. This is because the feature requires installation of CLR-based libraries into SQL Server.
50+
On SQL Server, you must enable the real-time scoring feature in advance to add the CLR-based libraries to SQL Server.
5251

53-
For information regarding realtime scoring in a distributed environment based on Microsoft R Server, please refer to the [publishService](https://docs.microsoft.com/machine-learning-server/r-reference/mrsdeploy/publishservice) function available in the [mrsDeploy package](https://docs.microsoft.com/machine-learning-server/r-reference/mrsdeploy/mrsdeploy-package), which supports publishing models for realtime scoring as a new a web service running on R Server.
52+
For information regarding real-time scoring in a distributed environment based on Microsoft R Server, refer to the [publishService](https://docs.microsoft.com/machine-learning-server/r-reference/mrsdeploy/publishservice) function available in the [mrsDeploy package](https://docs.microsoft.com/machine-learning-server/r-reference/mrsdeploy/mrsdeploy-package), which supports publishing models for real-time scoring as a new a web service running on R Server.
5453

5554
### Restrictions
5655

57-
+ The model must be trained in advance using one of the supported **rx** algorithms. For details, see [Supported algorithms](#bkmk_rt_supported_algos). Realtime scoring with `sp_rxPredict` supports both RevoScaleR and MicrosoftML algorithms.
56+
+ The model must be trained in advance using one of the supported **rx** algorithms. For details, see [Supported algorithms](#bkmk_rt_supported_algos). Real-time scoring with `sp_rxPredict` supports both RevoScaleR and MicrosoftML algorithms.
5857

5958
+ The model must be saved using the new serialization functions: [rxSerialize](https://docs.microsoft.com/machine-learning-server/r-reference/revoscaler/rxserializemodel) for R, and [rx_serialize_model](https://docs.microsoft.com/machine-learning-server/python-reference/revoscalepy/rx-serialize-model) for Python. These serialization functions have been optimized to support fast scoring.
6059

61-
+ Realtime scoring does not use an interpreter interpreter; therefore, any functionality that might require an interpreter is not supported during the scoring step. These might include:
60+
+ Real-time scoring does not use an interpreter; therefore, any functionality that might require an interpreter is not supported during the scoring step. These might include:
6261

6362
+ Models using the `rxGlm` or `rxNaiveBayes` algorithms are not currently supported
6463

65-
+ RevoScaleR models that use an R transformation function, or a formula that contains a transformation, such as <code>A ~ log(B)</code> are not supported in realtime scoring. To use a model of this type, we recommend that you perform the transformation on the to input data before passing the data to realtime scoring.
64+
+ RevoScaleR models that use an R transformation function, or a formula that contains a transformation, such as <code>A ~ log(B)</code> are not supported in real-time scoring. To use a model of this type, we recommend that you perform the transformation on the to input data before passing the data to real-time scoring.
6665

67-
+ Realtime scoring is currently optimized for fast predictions on smaller data sets, ranging from a few rows to hundreds of thousand of rows. On very large datasets, using [rxPredict](https://docs.microsoft.com/machine-learning-server/r-reference/revoscaler/rxpredict) might be faster.
66+
+ Real-time scoring is currently optimized for fast predictions on smaller data sets, ranging from a few rows to hundreds of thousands of rows. On big datasets, using [rxPredict](https://docs.microsoft.com/machine-learning-server/r-reference/revoscaler/rxpredict) might be faster.
6867

69-
### <a name="bkmk_rt_supported_algos">Algorithms that support realtime scoring
68+
### <a name="bkmk_rt_supported_algos">Algorithms that support real-time scoring
7069

7170
+ RevoScaleR models
7271

@@ -97,18 +96,15 @@ For information regarding realtime scoring in a distributed environment based on
9796

9897
### Unsupported model types
9998

100-
The following model types are not supported:
99+
Real-time scoring is not supported for R transformations other than those explicitly listed in the previous section.
101100

102-
+ Models containing other, unsupported types of R transformations
103-
+ Models using the `rxGlm` or `rxNaiveBayes` algorithms in RevoScaleR
104-
+ PMML models
105-
+ Models created using other R libraries from CRAN or other repositories
106-
+ Models containing any other kind of R transformation other than those listed here
101+
For developers accustomed to working with RevoScaleR and other Microsoft R-specific libraries, unsupported functions include
102+
`rxGlm` or `rxNaiveBayes` algorithms in RevoScaleR, PMML models, and other models created using other R libraries from CRAN or other repositories.
107103

108104
### Known issues
109105

110106
+ `sp_rxPredict` returns an inaccurate message when a NULL value is passed as the model: "System.Data.SqlTypes.SqlNullValueException:Data in Null".
111107

112108
## Next steps
113109

114-
[How to do realtime scoring](r/how-to-do-realtime-scoring.md)
110+
[How to do real-time scoring](r/how-to-do-realtime-scoring.md)

docs/advanced-analytics/toc.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,15 @@
8585
- name: Learn in-database analytics
8686
href: tutorials/sqldev-in-database-r-for-sql-developers.md
8787
items:
88-
- name: 1 - Get data and scripts
88+
- name: 1 - Set up demo data
8989
href: tutorials/sqldev-download-the-sample-data.md
90-
- name: 2 - Set up the environment
91-
href: r/sqldev-import-data-to-sql-server-using-powershell.md
92-
- name: 3 - Visualize data
90+
- name: 2 - Visualize data
9391
href: tutorials/sqldev-explore-and-visualize-the-data.md
94-
- name: 4 - Create data features
92+
- name: 3 - Create data features
9593
href: tutorials/sqldev-create-data-features-using-t-sql.md
96-
- name: 5 - Train and save to SQL
94+
- name: 4 - Train and save to SQL
9795
href: r/sqldev-train-and-save-a-model-using-t-sql.md
98-
- name: 6 - Predict outcomes
96+
- name: 5 - Predict outcomes
9997
href: tutorials/sqldev-operationalize-the-model.md
10098
- name: Data science end-to-end walkthrough
10199
href: tutorials/walkthrough-data-science-end-to-end-walkthrough.md
111 KB
Loading

0 commit comments

Comments
 (0)