Hello, I don’t understand what this code sequence does :
# to display nice model diagram from sklearn import set_config set_config(display='diagram')
I don’t see where the model diagrams are.
Thank you
Hello, I don’t understand what this code sequence does :
# to display nice model diagram from sklearn import set_config set_config(display='diagram')
I don’t see where the model diagrams are.
Thank you
The diagrams are the representation of scikit-learn object.
By default, without executing the set_config
, you type the following in a notebook cell, you will see a string as output:
from sklearn.neighbors import KNeighborsClassifier
KNeighborsClassifier()
KNeighborsClassifier()
However, if you run the set_config
command, the output will be a diagram instead. You will see that this is handy when you will make a complex machine learning pipeline composed of several elements.
I am afraid it doesn’t work in my case : I get the name of the classifier even when setting the diagram.
No, this output is an interactive diagram. You can try to change a parameter of the LogisticRegression
to a non-default parameter (e.g. LogisticRegression(C=100)
). Clicking on the diagram will be interactive and will show the non-default parameter.
As I said, this diagram will be useful in the subsequent notebook when the model will be a succession of transformer and a classifier (here you are dealing with a single classifier).
Ok, I think I’ve got it. I didn’t see that the text was clickable. It is visible on the Pipeline containing the StandardScaler and the LogisticRegression classifier. Thanks.