predict.onehot: Predict onehot objects

Description Usage Arguments Value Examples

Description

Predict onehot objects

Usage

1
2
## S3 method for class 'onehot'
predict(object, data, sparse = FALSE, sep = "_", ...)

Arguments

object

an object of class onehot

data

a data.frame to onehot encode useing object

sparse

if TRUE, returns a dgCMatrix-class

...

further arguments passed to or from other methods

Value

a matrix with factor variable onehot encoded

Examples

1
2
3
4
data(iris)
encoder <- onehot(iris)
x <- predict(encoder, iris)
x_sparse <- predict(encoder, iris, sparse=TRUE)

Zelazny7/onehot documentation built on May 6, 2019, 1:30 a.m.