-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathREADME.Rmd
79 lines (59 loc) · 3.11 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```
# cattonum
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/cattonum)](https://cran.r-project.org/package=cattonum)
[![R build status](https://github.com/bfgray3/cattonum/workflows/R-CMD-check/badge.svg)](https://github.com/bfgray3/cattonum)
[![Codecov test coverage](https://codecov.io/gh/bfgray3/cattonum/branch/develop/graph/badge.svg)](https://codecov.io/gh/bfgray3/cattonum?branch=develop)
[![Total Downloads](http://cranlogs.r-pkg.org/badges/grand-total/cattonum)](https://cran.r-project.org/package=cattonum)
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
[![Licence](https://img.shields.io/github/license/mashape/apistatus.svg)](http://choosealicense.com/licenses/mit/)
## Special note
I am currently looking for someone who would be interested in becoming the official maintainer of the package. Advanced skill in R or previous package development experience is not necessary. I will be able to help out with code review, etc. Please comment on [this issue](https://github.com/bfgray3/cattonum/issues/40) if you are interested.
## 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:
* aggregate function encoding: `catto_aggregate()`
* 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):
* [CatEncoders](https://cran.r-project.org/package=CatEncoders)
* [dummies](https://cran.r-project.org/package=dummies)
* [embed](https://github.com/tidymodels/embed)
* [fastDummies](https://cran.r-project.org/package=fastDummies)
* [FeatureHashing](https://cran.r-project.org/package=FeatureHashing)
* [h2o](https://cran.r-project.org/package=h2o)
* [makedummies](https://cran.r-project.org/package=makedummies)
* [recipes](https://cran.r-project.org/package=recipes)
* [vtreat](https://cran.r-project.org/package=vtreat)
## Installation
The development version can be installed from the `develop` branch on GitHub, which is the default branch.
```{r, eval = FALSE}
remotes::install_github("bfgray3/cattonum", ref = "develop")
```
The latest official release can be installed from [CRAN](https://CRAN.R-project.org/package=cattonum).
```{r, eval = FALSE}
install.packages("cattonum")
```
## Usage
```{r}
library(cattonum)
data(iris)
head(catto_loo(iris, response = Sepal.Length))
```
## Code of Conduct
Please note that this project is released with a
[Contributor Code of Conduct](https://github.com/bfgray3/cattonum/blob/develop/.github/CODE_OF_CONDUCT.md).
By contributing, you agree to abide by its terms.