nb_rank: Predicting label rankings based on the naive Bayes ranking...

Description Usage Arguments Details Value Examples

View source: R/nb_rank.R

Description

This function predicts the rankings given prior and conditional probabilities obtained from model_nbr

Usage

1
nb_rank(x, y, new.x, n = 1)

Arguments

x

is n x p matrix of n observations and p training attributes and can have continuous or nominal values.

y

is n x j matrix of label rankings

new.x

is a vector of new attributes

n

is a parameter of 'memory'; that is, how fast past gets forgotten. (see details of time_weights).

Details

This function predicts a ranking for test.x attributes. It initially builds a model for naive Bayes algorithm that calculates priors and conditional label ranking probabilities and then use them to predict rankings. The attributes can be nominal or continuous data.

Value

a numeric vector of ranking

Examples

1
2
3
train.x <- lr.nom[1:16,]
test.x <- lr.nom[17,]
predrank <- nb_rank(train.x,y,test.x,n=1)

Example output



labelrank documentation built on May 2, 2019, 11:10 a.m.