guess: Guess

Description Usage Arguments Details Value See Also Examples

View source: R/guess.r

Description

Infers the category of a new observation.

Usage

1
  guess(nn, X)

Arguments

nn

A trained and smoothed Probabilistic neural network.

X

A vector describing a new observation.

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.

Value

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

See Also

pnn-package, learn, smooth, perf, norms

Examples

1
2
3
4
5
6
7
8
9
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))

chasset/pnn documentation built on Nov. 17, 2018, 10:08 a.m.