Issue
I've been using jupyter lab for several month and every time I run a sklearn model the output is like this:
from sklearn.tree import DecisionTreeClassifier
clf = DecisionTreeClassifier(criterion="entropy", max_depth = 4)
clf
Which in the past showed this output:
DecisionTreeClassifier(ccp_alpha=0.0, class_weight=None, criterion='entropy',
max_depth=4, max_features=None, max_leaf_nodes=None,
min_impurity_decrease=0.0, min_impurity_split=None,
min_samples_leaf=1, min_samples_split=2,
min_weight_fraction_leaf=0.0, presort='deprecated',
random_state=None, splitter='best')
But now it only shows the params that I have actually set:
DecisionTreeClassifier(criterion='entropy', max_depth=4)
Anyone knows how to make Jupyter show the complete list of params again?
Solution
It is the new feature called print_only_changed
in the version 0.23. So don't roll down to previous version, just set the print_only_changed
option as False
.
from sklearn import set_config
from sklearn.tree import DecisionTreeClassifier
clf = DecisionTreeClassifier(criterion="entropy", max_depth = 4)
set_config(print_changed_only=True)
clf
# DecisionTreeClassifier(criterion='entropy', max_depth=4)
set_config(print_changed_only=False)
clf
# DecisionTreeClassifier(ccp_alpha=0.0, class_weight=None, criterion='entropy',
# max_depth=4, max_features=None, max_leaf_nodes=None,
# min_impurity_decrease=0.0, min_impurity_split=None,
# min_samples_leaf=1, min_samples_split=2,
# min_weight_fraction_leaf=0.0, presort='deprecated',
# random_state=None, splitter='best')
Answered By - Venkatachalam
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.