Scikit-Learn-1.2: SVM,

Source: Internet
Author: User

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.])

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.