SVM

1.4. Support Vector Machines

支持向量機

Support vector machines (SVMs) are a set of supervised learning methods used for classification, regression and outliers detection.

支持向量機是一種用于分類,回歸和異常值檢測的監督學習方式。

The advantages of support vector machines are:

SVM的優點如下:

Effective in high dimensional spaces.

在多維度空間中具有高效性。

Still effective in cases where number of dimensions is greater than the number of samples.

在特征值大于樣本數情況下仍舊高效。

Uses a subset of training points in the decision function (called support vectors), so it is also memory efficient.

在決定函數(稱為支持向量)中使用訓練集數據的一個子集,因此內存表現也高效。

Versatile: different Kernel functions can be specified for the decision function. Common kernels are provided, but it is also possible to specify custom kernels.

多功能性:可以為決定函數指定不同的核函數。提供常用的核函數,也可以指定你所習慣的核函數。

The disadvantages of support vector machines include:

缺點如下:

If the number of features is much greater than the number of samples, the method is likely to give poor performances.

如果特征值數遠遠超過樣本數,SVM性能可能不太好。

SVMs do not directly provide probability estimates, these are calculated using an expensive five-fold cross-validation (see Scores and probabilities, below).

SVM不直接提供概率評估,而是使用開銷五倍的交叉驗證來計算()

The support vector machines in scikit-learn support both dense (numpy.ndarray and convertible to that by numpy.asarray) and sparse (any scipy.sparse) sample vectors as input. However, to use an SVM to make predictions for sparse data, it must have been fit on such data. For optimal performance, use C-ordered numpy.ndarray (dense) or scipy.sparse.csr_matrix (sparse) with dtype=float64.

scikit-learn里的支持向量機同時支持dense(numpy中的ndarray數組和其他轉化成ndarray的數組)和sparse(scipy.sparse)樣本向量作為輸入。然而如果用SVM來對sparse數據做預測,要保證數據已經被適配。

SVC, NuSVC and LinearSVC are classes capable of performing multi-class classification on a dataset.

SVN,NuSVC 和LinearSVC都可以用來進行數據的多類分類。

../_images/plot_iris_0012.png

SVC and NuSVC are similar methods, but accept slightly different sets of parameters and have different mathematical formulations (see section Mathematical formulation). On the other hand, LinearSVC is another implementation of Support Vector Classification for the case of a linear kernel. Note that LinearSVC does not accept keyword kernel, as this is assumed to be linear. It also lacks some of the members of SVC and NuSVC, like support_.

As other classifiers, SVC, NuSVC and LinearSVC take as input two arrays: an array X of size [n_samples, n_features] holding the training samples, and an array y of class labels (strings or integers), size [n_samples]:

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • 2017年3月14日 星期二 陰 讀經:《易經》第31遍。運動:掄胳膊300下,蹲墻30下,閉眼金雞獨立5分鐘,...
    順德琪佳媽閱讀 450評論 1 3
  • 最近所在的的城市被陰雨天搶走了燦爛的陽光。電話回家,家里和我這一樣而且還下了湯圓大的冰雹。清明前后茶樹也慢慢...
    小手點點閱讀 395評論 0 0
  • 早上上班時間太早,自己做早餐往往時間來不及,路邊攤的餐點雖然方便快捷,但是衛生問題還是讓人不太放心,而且不一...
    素心齋閱讀 597評論 0 0