skmultilearn.base.base module

class skmultilearn.base.base.MLClassifierBase[source]

Bases: sklearn.base.BaseEstimator, sklearn.base.ClassifierMixin

Base class providing API and common functions for all multi-label classifiers.

Implements base functionality for ML classifiers, especially the get/set params for scikit-learn compatibility.

copyable_attrs

list of attribute names that should be copied when class is cloned

Type:List[str]
fit(X, y)[source]

Abstract method to fit classifier with training data

It must return a fitted instance of self.

Parameters:
  • X (numpy.ndarray or scipy.sparse) – input features, can be a dense or sparse matrix of size (n_samples, n_features)
  • y (numpy.ndaarray or scipy.sparse {0,1}) – binary indicator matrix with label assignments.
Returns:

fitted instance of self

Return type:

object

Raises:

NotImplementedError – this is just an abstract method

get_params(deep=True)[source]

Get parameters to sub-objects

Introspection of classifier for search models like cross-validation and grid search.

Parameters:deep (bool) – if True all params will be introspected also and appended to the output dictionary.
Returns:out – dictionary of all parameters and their values. If deep=True the dictionary also holds the parameters of the parameters.
Return type:dict
predict(X)[source]

Abstract method to predict labels

Parameters:X (numpy.ndarray or scipy.sparse.csc_matrix) – input features of shape (n_samples, n_features)
Returns:binary indicator matrix with label assignments with shape (n_samples, n_labels)
Return type:scipy.sparse of int
Raises:NotImplementedError – this is just an abstract method
set_params(**parameters)[source]

Propagate parameters to sub-objects

Set parameters as returned by get_params. Please see this link.