-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
DOC Fix load iris datasets #19729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC Fix load iris datasets #19729
Conversation
…s not defined" error is thrown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @maliozer !
I would prefer this be defined during the "Using the Iris dataset" section in line 131:
>>> from sklearn.datasets import load_iris
>>> from sklearn import tree
>>> iris = load_iris()
>>> X, y = iris.data, iris.target
>>> clf = tree.DecisionTreeClassifier()
>>> clf = clf.fit(X, y)
The reason I chose not to add it at the Using the Iris dataset section, is because it would be meaningless why the iris datasets is loaded twice until you don't apply the graphviz example. The above example demonstrates the return_X_y parameter usage. I tried to leave the example as it is. |
For this specific case, I think it is nice to show the complete usage of the >>> from sklearn.datasets import load_iris
>>> from sklearn import tree
>>> iris = load_iris()
>>> X, y = iris.data, iris.target
>>> clf = tree.DecisionTreeClassifier()
>>> clf = clf.fit(X, y) shows how to extract the Side note: Most of the user guide uses |
DOC Fix move definition of iris Bunch object top of the related section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
since the iris datasets is not defined above, the "name iris is not defined" error is thrown.
Reference Issues/PRs
What does this implement/fix? Explain your changes.
Any other comments?