|
17 | 17 | import numpy as np |
18 | 18 |
|
19 | 19 | from ..utils.validation import check_is_fitted |
| 20 | +from ..utils.validation import _deprecate_positional_args |
20 | 21 | from ..base import is_classifier |
21 | 22 |
|
22 | 23 | from . import _criterion |
@@ -77,7 +78,8 @@ def __repr__(self): |
77 | 78 | SENTINEL = Sentinel() |
78 | 79 |
|
79 | 80 |
|
80 | | -def plot_tree(decision_tree, max_depth=None, feature_names=None, |
| 81 | +@_deprecate_positional_args |
| 82 | +def plot_tree(decision_tree, *, max_depth=None, feature_names=None, |
81 | 83 | class_names=None, label='all', filled=False, |
82 | 84 | impurity=True, node_ids=False, |
83 | 85 | proportion=False, rotate='deprecated', rounded=False, |
@@ -656,7 +658,8 @@ def recurse(self, node, tree, ax, scale_x, scale_y, height, depth=0): |
656 | 658 | ax.annotate("\n (...) \n", xy_parent, xy, **kwargs) |
657 | 659 |
|
658 | 660 |
|
659 | | -def export_graphviz(decision_tree, out_file=None, max_depth=None, |
| 661 | +@_deprecate_positional_args |
| 662 | +def export_graphviz(decision_tree, out_file=None, *, max_depth=None, |
660 | 663 | feature_names=None, class_names=None, label='all', |
661 | 664 | filled=False, leaves_parallel=False, impurity=True, |
662 | 665 | node_ids=False, proportion=False, rotate=False, |
@@ -807,7 +810,8 @@ def compute_depth_(current_node, current_depth, |
807 | 810 | return max(depths) |
808 | 811 |
|
809 | 812 |
|
810 | | -def export_text(decision_tree, feature_names=None, max_depth=10, |
| 813 | +@_deprecate_positional_args |
| 814 | +def export_text(decision_tree, *, feature_names=None, max_depth=10, |
811 | 815 | spacing=3, decimals=2, show_weights=False): |
812 | 816 | """Build a text report showing the rules of a decision tree. |
813 | 817 |
|
|
0 commit comments