fit_knn | R Documentation |
klassets_response_xy
objectFit K Nearest Neighbours to klassets_response_xy
object
fit_knn(df, neighbours = 10, type = "prob")
df |
A object from |
neighbours |
The neighbours parameter. |
type |
Type of prediction, one of prob or response. |
set.seed(123) df <- sim_response_xy(relationship = function(x, y) x**2 > sin(y)) plot(df) # defaults to prob fit_knn(df) fit_knn(df, type = "response") plot(fit_knn(df)) plot(fit_knn(df, neighbours = 3)) plot(fit_knn(df, neighbours = 10)) plot(fit_knn(df, neighbours = 200)) plot(fit_knn(df, neighbours = 3, type = "response")) plot(fit_knn(df, neighbours = 10, type = "response")) plot(fit_knn(df, neighbours = 200, type = "response"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.