Skip to content
Encode Categorical Features
R C++
Branch: master
Clone or download
Latest commit 4141b66 Jan 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
R
man
revdep add revdep checks May 3, 2018
src Rcpp (#14) May 20, 2018
tests
vignettes Clarifying data set used in case study Feb 7, 2018
.Rbuildignore mkdir .github Jun 19, 2018
.gitignore initial commit; copy and modify bigo repo Dec 4, 2017
.travis.yml set up covr Jan 10, 2018
DESCRIPTION remove tibble from Suggests and don't call library() in tests Jan 19, 2019
LICENSE
LICENSE.md bump copyright year to 2018 Jan 7, 2018
NAMESPACE introduce s3 generics Jun 22, 2018
NEWS.md more progress on generalizing catto_label Apr 8, 2018
README.Rmd add mit badge to readme Jan 11, 2019
README.md add mit badge to readme Jan 11, 2019
appveyor.yml use AppVeyor Jan 10, 2018
cattonum.Rproj
codecov.yml set up covr Jan 10, 2018
cran-comments.md more prep for 0.0.2 May 2, 2018

README.md

cattonum

CRAN_Status_Badge Build Status AppVeyor Build Status Coverage status Total Downloads lifecycle Licence

Summary

cattonum (“cat to num”) provides different ways to encode categorical features as numerics. Its goal is to be a one-stop shop for all categorical encoding needs. It includes the following:

  • dummy encoding: catto_dummy
  • frequency encoding: catto_freq
  • label encoding: catto_label
  • leave-one-out encoding: catto_loo
  • mean encoding: catto_mean
  • median encoding: catto_median
  • one-hot encoding: catto_onehot

There are many existing packages with which to encode categorical features, including (among others):

Installation

The development version of cattonum can be installed from GitHub.

remotes::install_github("bfgray3/cattonum")

The latest official release of cattonum can be installed from CRAN.

install.packages("cattonum")

Usage

library(cattonum)
data(iris)
head(catto_loo(iris, response = Sepal.Length))
#>   Sepal.Length Sepal.Width Petal.Length Petal.Width  Species
#> 1          5.1         3.5          1.4         0.2 5.004082
#> 2          4.9         3.0          1.4         0.2 5.008163
#> 3          4.7         3.2          1.3         0.2 5.012245
#> 4          4.6         3.1          1.5         0.2 5.014286
#> 5          5.0         3.6          1.4         0.2 5.006122
#> 6          5.4         3.9          1.7         0.4 4.997959

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

You can’t perform that action at this time.