Skip to content

utils.Bunch's documentation. #16390

@adrinjalali

Description

@adrinjalali

It seems our documentation and the way we use Bunch are not synced. In the docs, we have:

Don’t make a bunch object! They are not part of the scikit-learn API. Bunch objects are just a way to package some numpy arrays. As a scikit-learn user you only ever need numpy arrays to feed your model with data.

For instance to train a classifier, all you need is a 2D array X for the input variables and a 1D array y for the target variables. The array X holds the features as columns and samples as rows . The array y contains integer values to encode the class membership of each sample in X.

At the same time, we use it in different places especially as an output. For instance:

return Bunch(importances_mean=np.mean(importances, axis=1),
importances_std=np.std(importances, axis=1),
importances=importances)

We also don't have a documentation for it, but it's part of our public API in a way.

Background: fairlearn/fairlearn#287

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions