The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Type: Package
Title: Fast Onehot Encoding for Data.frames
Version: 0.1.1
Author: Eric E. Graves [aut, cre]
Maintainer: Eric E. Graves <gravcon5@gmail.com>
Description: Quickly create numeric matrices for machine learning algorithms that require them. It converts factor columns into onehot vectors.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.0.1
NeedsCompilation: yes
Packaged: 2017-05-02 13:12:03 UTC; GravesEE
Repository: CRAN
Date/Publication: 2017-05-02 16:13:01 UTC

Onehot encode a data.frame

Description

Onehot encode a data.frame

Usage

onehot(data, stringsAsFactors = FALSE, addNA = FALSE, max_levels = 10)

Arguments

data

data.frame to convert factors into onehot encoded columns

stringsAsFactors

if TRUE, converts character vectors to factors

addNA

if TRUE, adds NA to factors as a level

max_levels

maximum number of levels to onehot encode per factor variable. Factors with levels exceeding this number will be skipped.

Value

a onehot object descrbing how to transform the data

Examples

data(iris)
encoder <- onehot(iris)

## add NAs to factors
encoder <- onehot(iris, addNA=TRUE)

## Convert character fields to factrs
encoder <- onehot(iris, stringsAsFactors=TRUE)

## limit which factors are onehot encoded
encoder <- onehot(iris, max_levels=5)

Predict onehot objects

Description

Predict onehot objects

Usage

## S3 method for class 'onehot'
predict(object, data, ...)

Arguments

object

an object of class onehot

data

a data.frame to onehot encode useing object

...

further arguments passed to or from other methods

Value

a matrix with factor variable onehot encoded

Examples

data(iris)
encoder <- onehot(iris)
x <- predict(encoder, iris)

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.