Machine learning using the sp_rxPredict stored procedure
Another method you can use for scoring predictions in the database is to use the sp_rxPredict
stored procedure. As you can see in the name, this process involves using the RevoScaleR
or the MicrosoftML
functions (a full list of the algorithms in those functions can be found in the following link).
Note
To use sp_rxPredict
, you'll need to enable the common language runtime (CLR) in SQL Server, but you don't need to install R or Python. You'll also need to enable real-time scoring by following the instructions here: https://docs.microsoft.com/en-us/sql/advanced-analytics/real-time-scoring?view=sql-server-ver15#bkmk_enableRtScoring.
With the prerequisites completed, you then have to follow this process to score the predictions in T-SQL:
- Load a trained model into a binary variable.
- Select the data you want to score.
- Call the
sp_rxPredict
function. - Receive the results.
Here's...