<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/building-a-machine-learning-model-with-the-microsoftml-package/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.revolutionanalytics.com/2017/01/microsoftml-taxi-trips.html"> Revolutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div>
<p><a target="_blank" rel="nofollow" href="https://www.microsoft.com/en-us/cloud-platform/r-server">Microsoft R Server 9</a> includes a new R package for machine learning: <a target="_blank" rel="nofollow" href="https://msdn.microsoft.com/en-us/microsoft-r/microsoftml-introduction">MicrosoftML</a>. (So do the <a target="_blank" rel="nofollow" href="https://azure.microsoft.com/en-us/marketplace/partners/microsoft-ads/standard-data-science-vm/">Data Science Virtual Machine</a> and the free <a target="_blank" rel="nofollow" href="https://msdn.microsoft.com/en-us/microsoft-r/r-client-get-started">Microsoft R Client</a> edition, incidentally.) This package includes a suite of fast predictive modeling functions implemented by Microsoft Research, including:</p>
<ul>
<li>Linear (<code>rxFastLinear</code>) and logistic (<code>rxLogisticRegression</code>) model functions based on the <a target="_blank" rel="nofollow" href="http://research.microsoft.com/en-us/um/people/mbilenko/papers/15-sasdca.pdf">Stochastic Dual Coordinate Ascent</a> method;</li>
<li>Classification/regression trees (<code>rxFastTrees</code>) and random forests (<code>rxFastForests</code>) based on <a target="_blank" rel="nofollow" href="http://projecteuclid.org/DPubS?service=UI&version=1.0&verb=Display&handle=euclid.aos/1013203451">FastRank</a>, an efficient implementation of the MART gradient boosting algorithm;</li>
<li>A neural network algorithm (<code>rxNeuralNet</code>) with support for custom, multilayer network topologies; and</li>
<li>One-class anomaly detection (<code>rxOneClassSvm</code>) based on <a target="_blank" rel="nofollow" href="https://www.microsoft.com/en-us/research/publication/estimating-the-support-of-a-high-dimensional-distribution/">support vector machines</a>.</li>
</ul>
<p>As the function names suggest, the implementations are tuned for speed: most use multiple CPUs, and some will even use the GPU (if available). Not all of the implementations scale to unlimited data sizes, however; all but the linear and logistic regression routines are bound by available RAM.</p>
<p>If you want to give these routines a try, the MIcrosoft R Server Tiger Team has prepared a <a target="_blank" rel="nofollow" href="https://blogs.msdn.microsoft.com/microsoftrservertigerteam/2017/01/17/predicting-nyc-taxi-tips-using-microsoftml/">walkthrough analyzing the famous NYC Taxi data set</a>. Once you have access to Microsoft R Server (or Client), <a target="_blank" rel="nofollow" href="https://gist.github.com/ramnov/7bc093e79f2222954c1e286c6c76b8f9#file-microsoftml_nyc_taxi_tip_prediction-r">this R script</a> walks you through the process of:</p>
<ul>
<li>Loading the MicrosoftML package</li>
<li>Importing the <a target="_blank" rel="nofollow" href="http://www.andresmh.com/nyctaxitrips/">NYC Taxi Data</a> from SQL Server (it comes preinstalled on the Data Science Virtual Machine)</li>
<li>Splitting the data into a test set and a training set, with the binary value &quot;tipped&quot; (whether or not the driver was tipped) as the response</li>
<li>Fitting several predictive models: logistic regression, linear model,, fast forest, and neural network.</li>
<li>Making predictions on the test data</li>
<li>Evaluating model performance by comparing AUC (area under the ROC curve)</li>
</ul>
<p>The ROC curves are shown below. As you'd expect the linear model performs poorly compared to the others, since it's being applied here to a binary variable.</p>
<p><a target="_blank" rel="nofollow" href="http://a7.typepad.com/6a0105360ba1c6970c01b7c8cdb16f970b-pi"><img title="ROC" alt="ROC" src="http://a7.typepad.com/6a0105360ba1c6970c01b7c8cdb16f970b-800wi" border="0"></a></p>
<p>To try it out yourself, follow the walkthrough linked below, which also provides instructions for running the logistic regression model in SQL Server Management Studio.</p>
<p>Microsoft R Server Tiger Team: <a target="_blank" rel="nofollow" href="https://blogs.msdn.microsoft.com/microsoftrservertigerteam/2017/01/17/predicting-nyc-taxi-tips-using-microsoftml/">Predicting NYC Taxi Tips using MicrosoftML</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/01/microsoftml-taxi-trips.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/JQDiA1YpnGw"></a></div>