# qiskit.aqua.components.multiclass_extensions.OneAgainstRest¶

class OneAgainstRest[ソース]

The One Against Rest multiclass extension.

For an $$n$$-class problem, the one-against-rest method constructs $$n$$ SVM classifiers, with the $$i$$-th classifier separating class $$i$$ from all the remaining classes, $$\forall i \in \{1, 2, \ldots, n\}$$. When the $$n$$ classifiers are combined to make the final decision, the classifier that generates the highest value from its decision function is selected as the winner and the corresponding class label is returned.

__init__()[ソース]

Initialize self. See help(type(self)) for accurate signature.

Methods

 Initialize self. Applying multiple estimators for prediction. set_estimator(estimator_cls[, params]) Called internally to set Estimator and parameters :type estimator_cls: Callable[[List], Estimator] :param estimator_cls: An Estimator class :type params: Optional[List] :param params: Parameters for the estimator test(x, y) Testing multiple estimators each for distinguishing a pair of classes. train(x, y) Training multiple estimators each for distinguishing a pair of classes.
predict(x)[ソース]

Applying multiple estimators for prediction.

パラメータ

x (numpy.ndarray) – NxD array

predicted labels, Nx1 array

numpy.ndarray

set_estimator(estimator_cls, params=None)

Called internally to set Estimator and parameters :type estimator_cls: Callable[[List], Estimator] :param estimator_cls: An Estimator class :type params: Optional[List] :param params: Parameters for the estimator

None

test(x, y)[ソース]

Testing multiple estimators each for distinguishing a pair of classes.

パラメータ
• x (numpy.ndarray) – input points

• y (numpy.ndarray) – input labels

accuracy

float

train(x, y)[ソース]

Training multiple estimators each for distinguishing a pair of classes.

パラメータ
• x (numpy.ndarray) – input points

• y (numpy.ndarray) – input labels

Exception – given all data points are assigned to the same class, the prediction would be boring