9
9
import numpy as np
10
10
11
11
from .basic import Booster
12
- from .compat import (MATPLOTLIB_INSTALLED , GRAPHVIZ_INSTALLED , LGBMDeprecationWarning ,
12
+ from .compat import (MATPLOTLIB_INSTALLED , GRAPHVIZ_INSTALLED ,
13
13
range_ , zip_ , string_type )
14
14
from .sklearn import LGBMModel
15
15
@@ -329,7 +329,7 @@ def plot_metric(booster, metric=None, dataset_names=None,
329
329
num_metric = len (metrics_for_one )
330
330
if metric is None :
331
331
if num_metric > 1 :
332
- msg = """more than one metric available, picking one to plot."" "
332
+ msg = "More than one metric available, picking one to plot."
333
333
warnings .warn (msg , stacklevel = 2 )
334
334
metric , results = metrics_for_one .popitem ()
335
335
else :
@@ -471,9 +471,6 @@ def add(root, total_count, parent=None, decision=None):
471
471
472
472
473
473
def create_tree_digraph (booster , tree_index = 0 , show_info = None , precision = 3 ,
474
- old_name = None , old_comment = None , old_filename = None , old_directory = None ,
475
- old_format = None , old_engine = None , old_encoding = None , old_graph_attr = None ,
476
- old_node_attr = None , old_edge_attr = None , old_body = None , old_strict = False ,
477
474
orientation = 'horizontal' , ** kwargs ):
478
475
"""Create a digraph representation of specified tree.
479
476
@@ -512,23 +509,6 @@ def create_tree_digraph(booster, tree_index=0, show_info=None, precision=3,
512
509
elif not isinstance (booster , Booster ):
513
510
raise TypeError ('booster must be Booster or LGBMModel.' )
514
511
515
- for param_name in ['old_name' , 'old_comment' , 'old_filename' , 'old_directory' ,
516
- 'old_format' , 'old_engine' , 'old_encoding' , 'old_graph_attr' ,
517
- 'old_node_attr' , 'old_edge_attr' , 'old_body' ]:
518
- param = locals ().get (param_name )
519
- if param is not None :
520
- warnings .warn ('{0} parameter is deprecated and will be removed in 2.4 version.\n '
521
- 'Please use **kwargs to pass {1} parameter.' .format (param_name , param_name [4 :]),
522
- LGBMDeprecationWarning )
523
- if param_name [4 :] not in kwargs :
524
- kwargs [param_name [4 :]] = param
525
- if locals ().get ('strict' ):
526
- warnings .warn ('old_strict parameter is deprecated and will be removed in 2.4 version.\n '
527
- 'Please use **kwargs to pass strict parameter.' ,
528
- LGBMDeprecationWarning )
529
- if 'strict' not in kwargs :
530
- kwargs ['strict' ] = True
531
-
532
512
model = booster .dump_model ()
533
513
tree_infos = model ['tree_info' ]
534
514
if 'feature_names' in model :
@@ -553,7 +533,6 @@ def create_tree_digraph(booster, tree_index=0, show_info=None, precision=3,
553
533
554
534
555
535
def plot_tree (booster , ax = None , tree_index = 0 , figsize = None , dpi = None ,
556
- old_graph_attr = None , old_node_attr = None , old_edge_attr = None ,
557
536
show_info = None , precision = 3 , orientation = 'horizontal' , ** kwargs ):
558
537
"""Plot specified tree.
559
538
@@ -600,15 +579,6 @@ def plot_tree(booster, ax=None, tree_index=0, figsize=None, dpi=None,
600
579
else :
601
580
raise ImportError ('You must install matplotlib to plot tree.' )
602
581
603
- for param_name in ['old_graph_attr' , 'old_node_attr' , 'old_edge_attr' ]:
604
- param = locals ().get (param_name )
605
- if param is not None :
606
- warnings .warn ('{0} parameter is deprecated and will be removed in 2.4 version.\n '
607
- 'Please use **kwargs to pass {1} parameter.' .format (param_name , param_name [4 :]),
608
- LGBMDeprecationWarning )
609
- if param_name [4 :] not in kwargs :
610
- kwargs [param_name [4 :]] = param
611
-
612
582
if ax is None :
613
583
if figsize is not None :
614
584
_check_not_tuple_of_2_elements (figsize , 'figsize' )
0 commit comments