-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
utils.Bunch's documentation. #16390
Description
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:
scikit-learn/sklearn/inspection/_permutation_importance.py
Lines 123 to 125 in 76de883
| 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