Fork me on GitHub

sklearn.multiclass.fit_ecoc

sklearn.multiclass.fit_ecoc(estimator, X, y, code_size=1.5, random_state=None, n_jobs=1)

Fit an error-correcting output-code strategy.

Parameters:

estimator : estimator object

An estimator object implementing fit and one of decision_function or predict_proba.

code_size : float, optional

Percentage of the number of classes to be used to create the code book.

random_state : numpy.RandomState, optional

The generator used to initialize the codebook. Defaults to numpy.random.

Returns:

estimators : list of int(n_classes * code_size) estimators

Estimators used for predictions.

classes : numpy array of shape [n_classes]

Array containing labels.

`code_book_`: numpy array of shape [n_classes, code_size] :

Binary array containing the code of each class.

Previous
Next