cvNumtoCat_WoE_fit: cvNumtoCat_WoE_fit

Description Usage Arguments Examples

View source: R/cvNumtoCat_WoE.R

Description

Convert the numeric feature to categorical feature by cross validated mean criteria then make WeO feature

Usage

1
cvNumtoCat_WoE_fit(data, vi, y, bin, k)

Arguments

data

data.table object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library(data.table)
library(binr)
library(rAutoFE)
library(rAutoFS)
library(h2o)
library(caret)
data(churn)
churn <- as.data.table(churn)
splits <- rAutoFE::splitFrame(dt=churn, ratio = c(0.5, 0.3), seed = 1234)
train <- splits[[1]]
valid <- splits[[2]]
test  <- splits[[3]]
h2o.init()
data_hex <- as.h2o(rbind(train, valid))
y = "Churn."
x = colnames(data_hex)[colnames(data_hex)!=y]
ml <- autoFS(data_hex, x, y, num_of_model=5, num_of_vi=20)
vi <- ml$top_vi
fit <- cvNumtoCat_WoE_fit(data=train, vi=vi, y, bin = 10, k = 5)

2econsulting/rAutoFE documentation built on May 24, 2019, 2:49 p.m.