8000 Outdated documentation for check_array and check_X_y · Issue #12331 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
Outdated documentation for check_array and check_X_y #12331
Closed
@dvukolov

Description

@dvukolov

Description

Documentation for utility functions check_array() and check_X_y() is outdated, stating that they convert input to a 2d array. This is not the case for 1D to 2D conversion since sklearn 0.19. Those functions instead raise an exception requiring that conversion to 2D be carried out manually. Only check_array() argument description reflects the new behaviour.

check_array() docs:

By default, the input is converted to an at least 2D numpy array.
Parameters:
  ensure_2d : boolean (default=True)
    Whether to raise a value error if X is not 2d.

check_X_y() docs:

Checks X and y for consistent length, enforces X 2d and y 1d.
Parameters:
  ensure_2d : boolean (default=True)
    Whether to make X at least 2d.

Utilities for Developers:

check_array: convert input to 2d array, raise error on sparse matrices. Allowed
sparse matrix formats can be given optionally, as well as allowing 1d or nd arrays.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0