視覺化最大邊界分隔器
在這個練習中,你要把最大邊界分隔器加到先前建立的散佈圖上。右側已經重現該圖。
本練習屬於課程
R 的支援向量機
練習說明
- 建立名為
separator的資料框,內容為最大邊界分隔器。它已存於變數mm_separator中(輸入mm_separator可查看)。 - 使用剛建立的資料框,將最大邊界分隔器加到先前建立的糖分散佈圖,並顯示結果。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
#create data frame containing the maximum margin separator
separator <- data.frame(sep = ___)
#add ggplot layer
plot_sep <- plot_ + geom_point(data = ___, aes(x = ___, y = 0), color = "blue", size = 4)
#display plot
plot_sep