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, ...

Get Hands-On Machine Learning with Azure now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.