The Algorithms logo
The Algorithms
AboutDonate

KNN

T
E
library(knn)
x <- cbind(x_train,y_train)
# Fitting model
fit <-knn(y_train ~ ., data = x,k=5)
summary(fit)
# Predict Output 
predicted= predict(fit,x_test)