-
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
Print the feature names in report.print_tree()
#23
Comments
Hello, can I work on this issue? I modified the TreePrinter struct and fit function to include the Running the example from the documentation https://docs.juliahub.com/MLJDecisionTreeInterface/QLzS8/0.2.5/autodocs/#MLJDecisionTreeInterface.DecisionTreeClassifier Current output:
New output:
Is the new output consistent with the required output of this issue? Please let me know if any further changes are required. |
This looks good to me with respect to the feature names. The only strange thing is, that the last part of the decision tree is different in the new output example ( Current output:
New output:
|
Yes, I think this is because of tie breaks while selecting the feature. Since both conditions (Feature 2 < 3.1 vs. Feature 1 < 5.95) are giving us the same output,
they have the same entropy/gini index etc. metric scores. In such cases, the algorithm may pick a random feature/ feature that occurred first during the iteration. I think this could be a possible reason for the observed difference. Also, I re-executed the code for the new output:
which is now the same as the current output. Let me know if it is okay or if I should dig deeper. |
Ah, I think that explains the situation well. So everything seems to work perfect! 👍 |
This commit addresses issue JuliaAI#23 by modifying TreePrinter struct and fit function to include the feature_names parameter.
closed by #54 |
This is actually possible, because
DecisionTree.print_tree()
has an option to pass the feature names: https://github.com/bensadeghi/DecisionTree.jl/blob/3fcb5b083e9abf45773ad1f22945473a7cc4ef89/src/DecisionTree.jl#L86cc @roland-KA
The text was updated successfully, but these errors were encountered: