-
- Downloads
[MRG+1] check length of feature_names in export_graphviz (#8477) (#8512)
* #8477 check length of feature_names in export_graphviz - raise ValueError if len(feature_names) > tree.n_features - add unit test for len(feature_names) > tree.n_features - change the comment of existing unit test for len(feature_names) < tree.n_features * fix error and warning - include length of feature_names and number of features in tree in the error and warning message. - raise error for too few feature_names - for too much feature_names, will use the first n_features. raise an warning for users - use assert_raise_message and assert_warns_message in test to check message. * move the error and warning from node_to_str to export_graphviz so it will fail early for wrong length of feature_names * raise error if length of feature_names does not match number of features in the decision tree * fix pep8 * remove unused assert_warns_message import in test_export.py * add bug fix in doc/whats_new.rst * fix the english in doc/whats_new.rst * fix the format and english in sklearn/tree/export.py * fix contributor format in doc/whats_new.rst * fix english, use bracket and avoid \ in error message * fix pep8 * fix pep8
Loading
Please register or sign in to comment