r - Objective function of an SVM -


I used the svm function in the e1071 package of RF software, using the variable selected by my feature selection method To model the data. I have received predictions from this model using the predict.svm function in the same package. I want to calculate the value of the objective function of SVM model using R software. how can I do this?

Below is my code for my first feature selection technique

  P1 < -Fold1T $ Class_NASQ InfGainF1 & lt; - info.gain (p1 ~., Fold1T [, -20]) subset & lt; - cutoff.k (InfGainF1, 8) f & lt; As.simple.formula (subset, "P1") ModelInGF1 & lt; -svm (as.factor (P1) ~ NSDQ.COMP + SP 100 + SP500 + NYSE.COMP + NYSE.AMMKT + RSEL.2000 + Allward + HG.SEGN, Data = Fold 1 AT [, - 20], Colonel = "Radial", Gamma = 0.5, Cost = 16) Estimated GF1 and LT; -Predatekate (Model INGF1, NewData = Fold 1V [, - 20]) ######## Accuracy ######## Illusion Matrix (Estimate Engineer 1, P1)  < / Pre> 

thanks

In 2010, learning about SVR, I discovered how the predictions To do this, I went to the "svminternals.pdf" file located in the e1071 / doc subfolder and run my custom code (shown after toy data) using the following data set

  ToyData & lt; - Data. Frame (X1 = C (12.4,14.6,13.4,12.9,15.2,13.6,9.2), X2 = C (2.1 9.2,1.9,0.8,1.1,8.6,1.1), Y = C (14.2, 16.9,15.5,14.7,17.3,16,10.9))   

You can find out the following code to see if you are somehow helpful.

  #Lenier Colonel Toydata & lt; - read.csv ("ToyData.csv", Header = T) X & lt; - as.matrix (ToyData [, 1: 2]) Y & LT; - as.vector (ToyData [, 3]) SVLLANER & lt; - svm (x, y, kernel = "linear", epicilon = 0.1, cost = 1, scale = fALSE) V    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -