Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand support Vector Machine in R language Advanced algorithm

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to understand the support vector machine in the advanced algorithm of R language, in order to solve this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

1. Principle Analysis of support Vector Machine

Machine learning is essentially an approximation to the real model of the problem studied, which usually assumes an approximate model, and then approaches the real model continuously according to the appropriate principle. Structural risk refers to the gap between the approximate model and the real model.

We can use some methods to approach the real model, and the most intuitive idea is to use the difference between the classification result of the classifier on the sample data and the real result, which is statistically called empirical risk Remp (W).

In the past machine learning methods, the empirical risk minimization is usually taken as the goal, but the model has no generalization ability because of over-fitting. Therefore, statistics introduces the concept of generalized error bound. The so-called generalization error bound means that the real risk should be described by two parts: one is the empirical risk, which represents the error of the classifier on a given sample, and the other is the confidence risk. it represents the extent to which we can trust the results of classifiers on unknown samples. The goal of statistical learning is from empirical risk minimization to seeking the sum of empirical risk and confidence risk minimization, that is, structural risk minimization (Structural Risk Minimization). Support vector machine is an algorithm that strives to minimize structural risk.

We can think of support vector machine as advanced linear regression or linear discrimination.

two。 Application in R language

We mainly use the svm (formula,data,type,kernel,degree,gamma,coef,nu) function in the e1071 package of R language.

The value of type is C-classification/nu-classification/one-classification/eps-regression/nu-regression. The first three are the classification of character-based result variables, the third is logical discrimination, that is, whether the output belongs to this category or not, and the latter two are the classification of quantitative result variables.

Kernel has four parameters, linear kernel function linear/ polynomial kernel function ploynomial/ radial basis kernel function (Gaussian function) radial basis/ neural network kernel function sigmoid. It is found that the Gaussian function has the highest recognition rate / performance, the polynomial function is the second, and the neural network function is the worst. The Gaussian function is a local function with strong learning ability but weak generalization ability, while the polynomial function is a global function.

3. Support Vector Machine Discriminant Analysis based on iris dataset

1) apply the model and observe the results

Fit_svm=svm (Species~.,data=iris)

Fit_ SVM [1: length (fit_svm)]

2) Forecast and model evaluation

This is the answer to the question about how to understand the support vector machine in the advanced algorithm of R language. I hope the above content can be of some help to you, if you still have a lot of doubts to be solved. You can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report