Learn R Programming

pnn (version 1.0.1)

guess: Guess

Description

Infers the category of a new observation.

Usage

guess(nn, X)

Arguments

nn
A trained and smoothed Probabilistic neural network.
X
A vector describing a new observation.

Value

A list of the guessed category and the probabilities of each category.

Details

Given an already trained and smoothed Probabilistic neural network, the function guess gives the category with the highest probability, and the probabilities of each category.

See Also

pnn-package, learn, smooth, perf, norms

Examples

Run this code
library(pnn)
data(norms)
pnn <- learn(norms)
pnn <- smooth(pnn, sigma=0.8)
guess(pnn, c(1,1))
guess(pnn, c(1,1))$category
guess(pnn, c(1,1))$probabilities
guess(pnn, c(2,1))
guess(pnn, c(1.5,1))

Run the code above in your browser using DataLab