puFactor: Convert a vector in a PU-Vector.

Description Usage Arguments Value Examples

View source: R/puFactor.R

Description

Convert a vector in a ordert factor with levels un<pos as required when using the one-class classiifiers from trainOcc.

Usage

1
puFactor(y, positive = NULL)

Arguments

y

a vector of labels or a numeric vector of length 2 where the first element specifies the number of positive and the second the number of negative samples.

positive

the label of the positive class in y. if not given the id with the smallest frequency is used.

Value

an ordererd factor with the levels un<pos

Examples

1
puFactor(rep( c( -1, -2, 1 ), c( 5, 10, 3 ) ), positive=1)

benmack/oneClass documentation built on Dec. 15, 2020, 7:38 p.m.