CommencerCommencer gratuitement

Polynomial SVM on a complex dataset

Calculate the average accuracy for a degree 2 polynomial kernel SVM using 100 different training/test partitions of the complex dataset you generated in the first lesson of this chapter. Use default settings for the parameters. The e1071 library has been preloaded and the dataset is available in the dataframe df. Use random 80/20 splits of the data in df when creating training and test datasets for each iteration.

Cet exercice fait partie du cours

Support Vector Machines in R

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

#create vector to store accuracies and set random number seed
accuracy <- rep(NA, ___)
set.seed(2)
Modifier et exécuter le code