0

I am new to spark. I have modeled decision tree using Dataframe based API i.e. pyspark.ml. I want to display rules of decision tree similar to what we get in RDD based API(spark.mllib) in spark using toDebugString. I have read the documentation and could not find how to display the rules. Is there any other way?

Thank you.

  • I think this answer: https://stackoverflow.com/questions/51614077/how-to-print-the-decision-path-rules-used-to-predict-sample-of-a-specific-row/51750088#51750088 answers your question – James Tobin Aug 16 '18 at 14:51
  • Possible duplicate of [How to extract rules from decision tree spark MLlib](https://stackoverflow.com/questions/31782288/how-to-extract-rules-from-decision-tree-spark-mllib) – pratiklodha Feb 15 '19 at 12:45

1 Answers1

0

As of Spark 2.0 both DecisionTreeClassificationModel and DecisionTreeRegressionModel provide toDebugString methods.