How to get the maxDepth from a Spark RandomForestRegressionModel
问题 In Spark (2.1.0) I've used a CrossValidator to train a RandomForestRegressor , using ParamGridBuilder for maxDepth and numTrees : paramGrid = ParamGridBuilder() \ .addGrid(rf.maxDepth, [2, 4, 6, 8, 10]) \ .addGrid(rf.numTrees, [10, 20, 40, 50]) \ .build() After training, I can get the best number of trees: regressor = cvModel.bestModel.stages[len(cvModel.bestModel.stages) - 1] print(regressor.getNumTrees) but I can't work out how to get the best maxDepth. I've read the documentation and I don