Scikit-Learn-1.2: SVM,
From: http://scikit-learn.org/stable/modules/svm.html#classification
SVM is a supervised learning method for classification, regression, and outlier detection.
SVM has the following advantages:
1.2.1 category
SVM has three Classification models: SVC (C-Support Vector Classification.), NuSVC (Nu-Support Vector Classification .),LinearSVC(Linear Support Vector Classification.
SVC and NuSVC are similar. However, they accept different parameter sets. There are different mathematical formulas.LinearSVC is another implementation method that supports vector classification. It supports linear kernel function input. It also has fewer parameters than SVC and NuSVC, such as support _
All three classification models are input two arrays. An array is X, [n_samples, n_features] as the training sample. The other y (Note X and y) serves as the class tag, size [n_samples].
From sklearn import svmx = [[0, 0], [1, 1] y = [0, 1] clf = svm. SVC () # in this way, clf indicates the SVC training algorithm clf. fit (X, y) # Train and extract features based on Features
After training, you can make predictions.
Clf. predict ([2 .., 2.])