-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[python] Improved python tree plots (#2304)
* Some basic changes to the plot of the trees to make them readable. * Squeezed the information in the nodes. * Added colouring when a dictionnary mapping the features to the constraints is passed. * Fix spaces. * Added data percentage as an option in the nodes. * Squeezed the information in the leaves. * Important information is now in bold. * Added a legend for the color of monotone splits. * Changed "split_gain" to "gain" and "internal_value" to "value". * Sqeezed leaves a bit more. * Changed description in the legend. * Revert "Sqeezed leaves a bit more." This reverts commit dd8bf14a3ba604b0dfae3b7bb1c64b6784d15e03. * Increased the readability for the gain. * Tidied up the legend. * Added the data percentage in the leaves. * Added the monotone constraints to the dumped model. * Monotone constraints are now specified automatically when plotting trees. * Raise an exception instead of the bug that was here before. * Removed operators on the branches for a clearer design. * Small cleaning of the code. * Setting a monotone constraint on a categorical feature now returns an exception instead of doing nothing. * Fix bug when monotone constraints are empty. * Fix another bug when monotone constraints are empty. * Variable name change. * Added is / isn't on every edge of the trees. * Fix test "tree_create_digraph". * Add new test for plotting trees with monotone constraints. * Typo. * Update documentation of categorical features. * Typo. * Information in nodes more explicit. * Used regular strings instead of raw strings. * Small refactoring. * Some cleaning. * Added future statement. * Changed output for consistency. * Updated documentation. * Added comments for colors. * Changed text on edges for more clarity. * Small refactoring. * Modified text in leaves for consistency with nodes. * Updated default values and documentaton for consistency. * Replaced CHECK with Log::Fatal for user-friendliness. * Updated tests. * Typo. * Simplify imports. * Swapped count and weight to improve readibility of the leaves in the plotted trees. * Thresholds in bold. * Made information in nodes written in a specific order. * Added information to clarify legend. * Code cleaning.
- Loading branch information
1 parent
b6d4ad8
commit f52be9b
Showing
12 changed files
with
163 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.