Skip to Main Content
Hands-On Machine Learning with Azure
book

Hands-On Machine Learning with Azure

by Thomas K Abraham, Parashar Shah, Jen Stirrup, Lauri Lehman, Anindita Basak, Ryan Murphy
October 2018
Intermediate to advanced content levelIntermediate to advanced
340 pages
7h 56m
English
Packt Publishing
Content preview from Hands-On Machine Learning with Azure

Using Spark for prediction

In this part of the chapter, the exercise is to use the Spark sample code to create a logistic regression model, save the model, and evaluate the performance of  the model on a test dataset.  For modeling, the features and class labels are specified using the RFormula function. In this example, we will train the model using the pipeline formula and a logistic regression estimator. This can be seen from the following code snippet:

logReg = LogisticRegression(maxIter=10, regParam=0.3, elasticNetParam=0.8)

The following code block sets up the training formula and assigns it to the classFormula variable, which can be seen from the following code:

classFormula = RFormula(formula="tipped ~ pickup_hour + weekday + ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Azure Machine Learning Engineering

Azure Machine Learning Engineering

Dennis Sawyers, Sina Fakhraee Ph.D, Balamurugan Balakreshnan, Megan Masanz
Mastering Azure Machine Learning - Second Edition

Mastering Azure Machine Learning - Second Edition

Christoph Körner, Marcel Alsdorf
Mastering Azure Machine Learning

Mastering Azure Machine Learning

Christoph Körner, Kaijisse Waaijer

Publisher Resources

ISBN: 9781789131956Supplemental Content