smbinning.gen {smbinning}R Documentation

Utility to generate a new characteristic from a numeric variable

Description

It generates a data frame with a new predictive characteristic after applying smbinning or smbinning.custom.

Usage

smbinning.gen(df, ivout, chrname = "NewChar")

Arguments

df

Dataset to be updated with the new characteristic.

ivout

An object generated after smbinning or smbinning.custom.

chrname

Name of the new characteristic.

Value

A data frame with the binned version of the original characteristic.

Examples

# Load library and its dataset
library(smbinning) # Load package and its data
pop=smbsimdf1 # Set population
train=subset(pop,rnd<=0.7) # Training sample

# Binning application for a numeric variable
result=smbinning(df=train,y="fgood",x="dep") # Run and save result

# Generate a dataset with binned characteristic
pop=smbinning.gen(pop,result,"g1dep")

# Check new field counts
table(pop$g1dep)

[Package smbinning version 0.9 Index]