Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.OneNN

Model Predictions


Description

This function predicts the class label of instances or its probability of pertaining to each class based on the distance matrix.

Usage

## S3 method for class 'OneNN'
predict(object, dists, type = "prob", ...)

Arguments

object

A model of class OneNN built with oneNN

dists

A matrix of distances between the instances to classify (by rows) and the instances used to train the model (by column)

type

A string that can take two values: "class" for computing the class of the instances or "prob" for computing the probabilities of belonging to each class.

...

Currently not used.

Value

If type is equal to "class" a vector of length equal to the rows number of matrix dists, containing the predicted labels. If type is equal to "prob" it returns a matrix which has nrow(dists) rows and a column for every class, where each cell represents the probability that the instance belongs to the class, according to 1NN.


SSLR

Semi-Supervised Classification, Regression and Clustering Methods

v0.9.3.1
GPL-3
Authors
Francisco Jesús Palomares Alabarce [aut, cre] (<https://orcid.org/0000-0002-0499-7034>), José Manuel Benítez [ctb] (<https://orcid.org/0000-0002-2346-0793>), Isaac Triguero [ctb] (<https://orcid.org/0000-0002-0150-0651>), Christoph Bergmeir [ctb] (<https://orcid.org/0000-0002-3665-9021>), Mabel González [ctb] (<https://orcid.org/0000-0003-0152-444X>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.