Search code examples
apache-sparkmachine-learningscale

view machine learning model derived in Spark


I have a general question, I guess it is common to many Spark ML users, but I searched over the internet, and didn't find an answer.

Let's say if I use one of the estimators from Spark ML package to fit a data set with a model. How can view the model? For example the model is a decision tree, how can I view the actual tree? All the nodes, splits, etc.

Thanks, -Fan


Solution

  • For a decision tree:

    tree_model.toDebugString()

    Not all algorithms have visual components, and even some that may have visual components do not necessarily have that aspect implemented in Spark.