1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/knn3.R
\name{predict.knn3}
\alias{predict.knn3}
\title{Predictions from k-Nearest Neighbors}
\usage{
\method{predict}{knn3}(object, newdata, type = c("prob", "class"), ...)
}
\arguments{
\item{object}{object of class \code{knn3}.}
\item{newdata}{a data frame of new observations.}
\item{type}{return either the predicted class or the proportion of the votes
for the winning class.}
\item{...}{additional arguments.}
}
\value{
Either the predicted class or the proportion of the votes for each
class.
}
\description{
Predict the class of a new observation based on k-NN.
}
\details{
This function is a method for the generic function \code{\link{predict}} for
class \code{knn3}. For the details see \code{\link{knn3}}. This is
essentially a copy of \code{\link[ipred]{predict.ipredknn}}.
}
\author{
\code{\link[ipred]{predict.ipredknn}} by Torsten.Hothorn
<Torsten.Hothorn@rzmail.uni-erlangen.de>
}
\keyword{multivariate}
|