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

Loading a pipeline model and evaluating the test data

In this example, we will load a pipeline model and then evaluate the test data:

savedModel = PipelineModel.load(logRegDirfilename)predictions = savedModel.transform(testData)predictionAndLabels = predictions.select("label","prediction").rddmetrics = BinaryClassificationMetrics(predictionAndLabels)print("Area under ROC = %s" % metrics.areaUnderROC)

In the next step, we define random forest models:

randForest = RandomForestRegressor(featuresCol = 'indexedFeatures', labelCol = 'label',featureSubsetStrategy="auto",impurity='variance', maxBins=100)

Now, we will define a modeling pipeline that includes formulas, feature transformations, and an estimator:

pipeline = Pipeline(stages=[regFormula, ...
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