Find the maximal margin separator
Recall that the dataset we are working with consists of measurements of sugar content of 25 randomly chosen samples of two soft drinks, one regular and the other reduced sugar. In one of our earlier plots, we identified two distinct clusters (classes). A dataset in which the classes do not overlap is called separable, the classes being separated by a decision boundary. The maximal margin separator is the decision boundary that is furthest from both classes. It is located at the mean of the relevant extreme points from each class. In this case the relevant points are the highest valued point in the low sugar content class and the lowest valued point in the high sugar content class. This exercise asks you to find the maximal margin separator for the sugar content dataset.
This exercise is part of the course
Support Vector Machines in R
Exercise instructions
- Find the maximal margin separator and assign it to the variable
mm_separator
. - Use the displayed plot to find the sugar content values of the relevant extremal data points in each class.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
#The maximal margin separator is at the midpoint of the two extreme points in each cluster.
mm_separator <- (___ + ___)/2