Aan de slagGa gratis aan de slag

Average accuracy for linear SVM

In this exercise you will calculate the average accuracy for a default cost linear SVM using 100 different training/test partitions of the dataset you generated in the first lesson of this chapter. 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.

Deze oefening maakt deel uit van de cursus

Support Vector Machines in R

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Create vector to store accuracies and set random number seed
accuracy <- rep(NA, ___)
set.seed(2)
Code bewerken en uitvoeren