Last active
March 7, 2019 19:56
-
-
Save mrafayaleem/79b23ff3bd9a6c5b6850de7b88fd7373 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Train the model and get predictions on the validation set | |
antbeeModel = pipeline.fit(trainingDF) | |
predictionDF = antbeeModel.transform(validationDF).cache() | |
predictionDF.sample(False, 0.1).show() | |
# Evaluate predictions | |
evaluator = MulticlassClassificationEvaluator( | |
labelCol="label", predictionCol="prediction", metricName="accuracy") | |
accuracy = evaluator.evaluate(predictionDF) | |
# expected error should be less than 10% | |
print("The Test Error is = %g " % (1.0 - accuracy)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment