knn_viz: Visualize the kNN classifiers

Description Usage Arguments Value

Description

Plots the kNN decision boundary for 2D problems.

Usage

1
2
knn_viz(train, cl, k = 7, validate = NULL, cl_validate = NULL,
  prob_size = T)

Arguments

train

matrix or data.frame with 2 columns

cl

vector of training classes

k

number of neighbors

validate

matrix or data.frame with 2 columns

cl_validate

vector of classes

prob_size

whether to adjust the size of points depending on the estimated probabilities

Value

a ggplot object


jlaria/dsclass documentation built on May 5, 2019, 7:09 a.m.