Skip to content

Instantly share code, notes, and snippets.

@GKarmakar
Created December 19, 2018 04:06
Show Gist options
  • Select an option

  • Save GKarmakar/589ad57025456a9ed40fee0678319e74 to your computer and use it in GitHub Desktop.

Select an option

Save GKarmakar/589ad57025456a9ed40fee0678319e74 to your computer and use it in GitHub Desktop.
from pyspark.ml.classification import RandomForestClassifier
RandomForestEstimator = RandomForestClassifier(featuresCol="rawFeatures", labelCol="churn")
RandomForestModel = RandomForestClassifier.fit(preprocessedStageTraining3)
predictionsRandomForestTrainingDF = RandomForestModel .transform(predictionsTrainingDF)
predictionsRandomForestTestDF = RandomForestModel .transform(predictionsTestDF)
display_train_and_test_f1_score("Random Forest", predictionsRandomForestTrainingDF, predictionsRandomForestTestDF)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment