開始使用免費開始

視覺化最大邊界分隔器

在這個練習中,你要把最大邊界分隔器加到先前建立的散佈圖上。右側已經重現該圖。

本練習屬於課程

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
編輯並執行程式碼