Scikit-Learn
69
SVCClf.support_
Output
array([0, 2])
SVCClf.intercept_
Output
array([-0.])
SVCClf.fit_status_
Output
0
NuSVC
NuSVC is Nu Support Vector Classification. It is another class
provided by scikit-learn
which can perform multi-class classification. It is like SVC
but NuSVC accepts slightly
different sets of parameters. The parameter which is different from SVC is as follows:
nu:
float, optional, default = 0.5
It represents an upper bound on the fraction of training errors and a lower bound of the
fraction of support vectors. Its value should be in the interval of (o,1].
Rest of the parameters and attributes are same as of SVC.
Implementation Example
We can implement the same example using
sklearn.svm.NuSVC
class also.
import
numpy as np
X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]])
y = np.array([1, 1, 2, 2])
from sklearn.svm
import NuSVC
NuSVCClf = NuSVC(kernel='linear',gamma='scale', shrinking=False,)
NuSVCClf.fit(X, y)
Output
NuSVC(cache_size=200, class_weight=None, coef0=0.0,
Scikit-Learn
70
decision_function_shape='ovr', degree=3, gamma='scale', kernel='linear',
max_iter=-1, nu=0.5, probability=False, random_state=None,
shrinking=False, tol=0.001, verbose=False)
We can get the outputs of rest of the attributes as did in the case of SVC.
Dostları ilə paylaş: