The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
https://doi.org/10.32614/CRAN.package.penalizedSVM
The goal of penalizedSVM is to support Vector Machine (SVM) classification with simultaneous feature selection using penalty functions is implemented. The smoothly clipped absolute deviation (SCAD), ‘L1-norm’, ‘Elastic Net’ (‘L1-norm’ and ‘L2-norm’) and ‘Elastic SCAD’ (SCAD and ‘L2-norm’) penalties are available. The tuning parameters can be found using either a fixed grid or a interval search.
You can install the released version of peperr from CRAN with:
install.packages("penalizedSVM")And the development version from GitHub with:
install.packages("devtools")
devtools::install_github("fbertran/penalizedSVM")This is a basic example.
library(penalizedSVM)seed<- 123
train<-sim.data(n = 200, ng = 100, nsg = 10, corr=FALSE, seed=seed )
print(str(train))
#> List of 3
#> $ x : num [1:100, 1:200] 0.547 0.635 -0.894 0.786 2.028 ...
#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : chr [1:100] "pos1" "pos2" "pos3" "pos4" ...
#> .. ..$ : chr [1:200] "1" "2" "3" "4" ...
#> $ y : Named num [1:200] 1 -1 -1 1 -1 -1 1 -1 -1 -1 ...
#> ..- attr(*, "names")= chr [1:200] "1" "2" "3" "4" ...
#> $ seed: num 123
#> NULLTrain standard svm
my.svm<-svm(x=t(train$x), y=train$y, kernel="linear")Test with other data
test<- sim.data(n = 200, ng = 100, nsg = 10, seed=(seed+1) )Check accuracy standard SVM
my.pred <-ifelse( predict(my.svm, t(test$x)) >0,1,-1)Check accuracy:
table(my.pred, test$y)
#>
#> my.pred -1 1
#> -1 81 23
#> 1 30 66These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.