<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/real-time-scoring-with-microsoft-r-server-9-1/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.revolutionanalytics.com/2017/05/real-time-scoring-with-mrs-91.html"> Revolutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div>
<p>Once you've built a predictive model, in many cases the next step is to operationalize the model: that is, generate predictions from the pre-trained model in real time. In this scenario, <strong>latency</strong> becomes the critical metric: new data typically become available a single row at a time, and it's important to respond with that single prediction (or score) as quickly as possible.</p>
<p>Consider the example of presenting your credit card for payment at a store: the bank has to evaluate that transaction as being fraudulent or not, and return that signal to the store while you wait for the credit card machine to respond. In order to minimize your waiting time, and considering that thousands of transactions may be processed each second, a response must be generated in milliseconds.</p>
<p>Now, with Microsoft R Server 9.1, <a target="_blank" rel="nofollow" href="https://blogs.msdn.microsoft.com/rserver/2017/04/19/whats-new-in-r-server-9-1-operationalization/">you can operationalize certain models</a> trained using the <a target="_blank" rel="nofollow" href="https://msdn.microsoft.com/en-us/microsoft-r/scaler/scaler">RevoScaleR</a> and <a target="_blank" rel="nofollow" href="https://msdn.microsoft.com/en-us/microsoft-r/microsoftml/microsoftml">MicrosoftML</a> packages as real-time web services. These web services use the R objects you create when you train the model, but don't themselves rely on an R interpreter. This means the latency of the service is very low, and can respond in a matter of milliseconds.</p>
<p><a target="_blank" rel="nofollow" href="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b8d27ee95d970c-pi"><img title="Operationalization" alt="Operationalization" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b8d27ee95d970c-800wi" border="0"></a></p>
<p>To publish a model as a web service, you'll need an instance of Microsoft R Server for Windows or SQL Server 2017 Machine Learning Services to act as the host. Once you've used the <a target="_blank" rel="nofollow" href="https://msdn.microsoft.com/en-us/microsoft-r/operationalize/data-scientist-manage-services"><code>publishService</code> function</a> (with the <code>serviceType=RealTime</code> option) to operationalize your model, you can generate scores from any application on any remote platform using the <a target="_blank" rel="nofollow" href="http://swagger.io/">Swagger</a> RESTful API service it creates. The model types supported include the <code>rxLogit</code>, <code>rxLinMod</code>, <code>rxBTrees</code>, <code>rxDTree</code>, and <code>rxDForest</code> functions (from the RevolScaleR package), and <code>rxFastTrees</code>, <code>rxFastForest</code>, <code>rxLogisticRegression</code>, <code>rxOneClassSvm</code>, <code>rxNeuralNet</code>, <code>rxFastLinear</code>, <code>featurizeText</code>, <code>featurizeImage</code>, and <code>getSentiment</code> (from the MicrosoftML package).  You can <a target="_blank" rel="nofollow" href="https://msdn.microsoft.com/en-us/microsoft-r/operationalize/data-scientist-manage-services#realtime-example">see a complete example here</a>.</p>
<p>For more on operationalizing models in R Server 9.1, check out the blog post linked below.</p>
<p>Microsoft R Blog: <a target="_blank" rel="nofollow" href="https://blogs.msdn.microsoft.com/rserver/2017/04/19/whats-new-in-r-server-9-1-operationalization/">What’s new in R Server 9.1 Operationalization</a></p>
</div>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://blog.revolutionanalytics.com/2017/05/real-time-scoring-with-mrs-91.html"> Revolutions</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/ePWB6RK4tzE"></a></div>