Skip to content

Use return_X_y=True when applicable in examples #14347

@qinhanmin2014

Description

@qinhanmin2014

In our examples, we still have things like

digits = datasets.load_digits()
X_digits = digits.data
y_digits = digits.target

(See https://scikit-learn.org/dev/auto_examples/compose/plot_digits_pipe.html#sphx-glr-auto-examples-compose-plot-digits-pipe-py)
We can replace this with

X_digits, y_digits = datasets.load_digits(return_X_y=True)

An easy way is to search for .data and .target in the examples and use return_X_y=True when applicable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EasyWell-defined and straightforward way to resolveSprintgood first issueEasy with clear instructions to resolvehelp wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions