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
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.
17
17
18
18
> [!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).
20
20
21
-
## How realtime scoring works
21
+
## How real-time scoring works
22
22
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.
24
24
25
25
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.
26
26
27
-
Realtime scoring is a multi-step process:
27
+
Real-time scoring is a multi-step process:
28
28
29
29
1. The stored procedure that does scoring must be enabled on a per-database basis.
30
30
2. You load the pre-trained model in binary format.
@@ -33,40 +33,39 @@ Realtime scoring is a multi-step process:
33
33
34
34
## Get started
35
35
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).
37
37
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/)
39
39
40
40
> [!TIP]
41
41
> 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.
42
42
43
43
## Requirements
44
44
45
-
Realtime scoring is supported on these platforms:
45
+
Real-time scoring is supported on these platforms:
46
46
47
47
+ 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
50
49
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.
52
51
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.
54
53
55
54
### Restrictions
56
55
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.
58
57
59
58
+ 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.
60
59
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:
62
61
63
62
+ Models using the `rxGlm` or `rxNaiveBayes` algorithms are not currently supported
64
63
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.
66
65
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.
68
67
69
-
### <aname="bkmk_rt_supported_algos">Algorithms that support realtime scoring
68
+
### <aname="bkmk_rt_supported_algos">Algorithms that support real-time scoring
70
69
71
70
+ RevoScaleR models
72
71
@@ -97,18 +96,15 @@ For information regarding realtime scoring in a distributed environment based on
97
96
98
97
### Unsupported model types
99
98
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.
101
100
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.
107
103
108
104
### Known issues
109
105
110
106
+`sp_rxPredict` returns an inaccurate message when a NULL value is passed as the model: "System.Data.SqlTypes.SqlNullValueException:Data in Null".
111
107
112
108
## Next steps
113
109
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)
0 commit comments