You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Visualization of FastTree Results from RegressionExperiment (Descicion Tree Visualization) #5761
Assuming we create a new RegressionExperiment, generate some Test and Training Data and after Executing the Experiment we see that a FastTreeRegression was the BestRun of the ExperimentResult<RegressionMetrics>.
In Scikit (Python), you can directly let the Library Plot the Descicion Tree, but in ML.NET I haven't found such a possibility yet.
Is there a simple way that I am missing to create some kind of data structure (or JSON) that would print the descicion tree? Favorably with Labels and the threshhold value.
I have found other issues concerning this Problem but they all were closed without an actual solution in 2018 or 2019, so this didn't help me at all, sadly.
I know we can extract the Transformer and corresponding TreeEnsemble from a RunDetail<RegressionMetrics> via some ugly casting (((PredictionTransformerBase<Microsoft.ML.Trainers.FastTree.FastTreeRegressionModelParameters>)((TransformerChain<IPredictionTransformer<object>>)bestRun.Model)), but I sadly do not know where to go from there.
And since I am not too familiar with the API as well - Is there any built-in way on receiving the Information on how the descicion tree(s) is/are built up which can also be used to visualize as a graph?
Source code / logs
What I am doing at the moment looks something like this:
RegressionExperimentexperiment=context.Auto().CreateRegressionExperiment(60*10);vartrainTestData=CreateTrainTestData();//Create some testdata with TrainTestSplitExperimentResult<RegressionMetrics>experimentResult=experiment.Execute(trainTestData.TrainSet,"Label")//We assume we will always get a FastDescicionTree for the examplevartransformer=((PredictionTransformerBase<Microsoft.ML.Trainers.FastTree.FastTreeRegressionModelParameters>)((TransformerChain<IPredictionTransformer<object>>)bestRun.Model).LastTransformer;varensemble=transformer.Model.TrainedTreeEnsemble;//Now, how to visualize?
Triage: There is no built-in tree plot, but the FastTree regression model exposes TrainedTreeEnsemble.Trees which could be helpful for this task. We currently do not have capacity to invest into built-in visualization.
Activity
matouskozak commentedon Oct 23, 2026
Triage: There is no built-in tree plot, but the FastTree regression model exposes TrainedTreeEnsemble.Trees which could be helpful for this task. We currently do not have capacity to invest into built-in visualization.