MultiOutputClassifier
¶
-
class
ibex.sklearn.multioutput.
MultiOutputClassifier
(estimator, n_jobs=1)¶ Bases:
sklearn.multioutput.MultiOutputClassifier
,ibex._base.FrameMixin
Note
The documentation following is of the class wrapped by this class. There are some changes, in particular:
- A parameter
X
denotes apandas.DataFrame
. - A parameter
y
denotes apandas.Series
.
Multi target classification
This strategy consists of fitting one classifier per target. This is a simple strategy for extending classifiers that do not natively support multi-target classification
- estimator : estimator object
- An estimator object implementing fit, score and predict_proba.
- n_jobs : int, optional, default=1
- The number of jobs to use for the computation. If -1 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one are used. The number of jobs to use for the computation. It does each target variable in y in parallel.
- estimators_ : list of
n_output
estimators - Estimators used for predictions.
-
fit
(X, y, sample_weight=None)¶ Note
The documentation following is of the class wrapped by this class. There are some changes, in particular:
- A parameter
X
denotes apandas.DataFrame
. - A parameter
y
denotes apandas.Series
.
- Fit the model to data.
Fit a separate model for each output variable.
- X : (sparse) array-like, shape (n_samples, n_features)
- Data.
- y : (sparse) array-like, shape (n_samples, n_outputs)
- Multi-output targets. An indicator matrix turns on multilabel estimation.
- sample_weight : array-like, shape = (n_samples) or None
- Sample weights. If None, then samples are equally weighted. Only supported if the underlying regressor supports sample weights.
- self : object
- Returns self.
- A parameter
-
partial_fit
(X, y, classes=None, sample_weight=None)¶ Note
The documentation following is of the class wrapped by this class. There are some changes, in particular:
- A parameter
X
denotes apandas.DataFrame
. - A parameter
y
denotes apandas.Series
.
- Incrementally fit the model to data.
Fit a separate model for each output variable.
- X : (sparse) array-like, shape (n_samples, n_features)
- Data.
- y : (sparse) array-like, shape (n_samples, n_outputs)
- Multi-output targets.
- classes : list of numpy arrays, shape (n_outputs)
- Each array is unique classes for one output in str/int
Can be obtained by via
[np.unique(y[:, i]) for i in range(y.shape[1])]
, where y is the target matrix of the entire dataset. This argument is required for the first call to partial_fit and can be omitted in the subsequent calls. Note that y doesn’t need to contain all labels in classes. - sample_weight : array-like, shape = (n_samples) or None
- Sample weights. If None, then samples are equally weighted. Only supported if the underlying regressor supports sample weights.
- self : object
- Returns self.
- A parameter
-
predict
(X)¶ Note
The documentation following is of the class wrapped by this class. There are some changes, in particular:
- A parameter
X
denotes apandas.DataFrame
. - A parameter
y
denotes apandas.Series
.
- Predict multi-output variable using a model
- trained for each target variable.
- X : (sparse) array-like, shape (n_samples, n_features)
- Data.
- y : (sparse) array-like, shape (n_samples, n_outputs)
- Multi-output targets predicted across multiple predictors. Note: Separate models are generated for each predictor.
- A parameter
-
predict_proba
(X)[source]¶ Note
The documentation following is of the class wrapped by this class. There are some changes, in particular:
- A parameter
X
denotes apandas.DataFrame
. - A parameter
y
denotes apandas.Series
.
- Probability estimates.
Returns prediction probabilities for each class of each output.
- X : array-like, shape (n_samples, n_features)
- Data
- p : array of shape = [n_samples, n_classes], or a list of n_outputs such arrays if n_outputs > 1.
- The class probabilities of the input samples. The order of the classes corresponds to that in the attribute classes_.
- A parameter
-
score
(X, y)[source]¶ Note
The documentation following is of the class wrapped by this class. There are some changes, in particular:
- A parameter
X
denotes apandas.DataFrame
. - A parameter
y
denotes apandas.Series
.
“Returns the mean accuracy on the given test data and labels.
- X : array-like, shape [n_samples, n_features]
- Test samples
- y : array-like, shape [n_samples, n_outputs]
- True values for X
- scores : float
- accuracy_score of self.predict(X) versus y
- A parameter
- A parameter