-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plotting trees with TreeRecipe.jl #56
Comments
Hello, I went through the RecipesBase documentation and needed some help understanding the plot recipe's integration. I had some questions:
Also, please let me know if these questions make sense or if I'm thinking in the wrong direction😅 |
I've looked into this a bit further. I have an idea how to do it but it's a bit involved. The first step is to replace the current So, we create a new struct struct DecisionTreeClassifierFitResult{T,C,I}
tree::T
classes_seen::C
integers_seen::I
features::Vector{Symbol}
end and instead of We will have to modify the definition of We do something similar for DecisionTreeRegressor, whose We should be careful that none of these changes breaks anything. Since @adarshpalaskar1 You want to have a go at a PR to do this internal wrapping? |
Sorry for the delayed response. I went through the implementation steps you provided, and I am eager to work on a PR. I added the above mentioned changes for the In the above mentioned example, (https://github.com/JuliaAI/TreeRecipe.jl/blob/master/examples/DecisionTree_iris.jl), we have:
wrapped tree in example:
Where as in case of DecisionTreeInterface, we have:
wrapped tree in fitted_params:
Due to which we get:
and similarly, after adding a recipe for wrapping:
How can I handle this mismatch in the datatypes? |
The following example shows how to manually plot the trees learned in DecisionTree.jl:
https://github.com/JuliaAI/TreeRecipe.jl/blob/master/examples/DecisionTree_iris.jl
Currently, the way to integrate a plot recipe in MLJ.jl is not documented, but is sketched in this comment.
So, can we somehow put this together to arrange that a workflow like this generates a plot of a decision tree?
edited again (x2):
Note: It used to be that you made RecipesBase.jl your dependency, to avoid a full Plots.jl dependency. But now the recipes live in Plots.jl and you are expected to make Plots.jl a weak dependency. You can see an example of this here.
The text was updated successfully, but these errors were encountered: