disc_test_data: Discretization for test dataset

Description Usage Arguments Details Value Examples

View source: R/nb.R

Description

After getting cut points from train data, we could apply this cut points for discretization of test data

Usage

1
disc_test_data(x, cutp)

Arguments

x

A dataframe of test data with some numeric columns

cutp

cut points from train dataset

Details

function to discrete the test data with cut points from train dataset.

Value

new test data after discretization

Examples

1
2
3
4
5
6
x=iris[c(1:40,51:90,101:140),-5]
y=iris[c(1:40,51:90,101:140),5]
testx = iris[c(41:50,91:100,141:150),-5]
v = disc_train_data(x,y)
testx_dis = disc_test_data(testx,v$cutp)
testx_dis

sharechanxd/myNBpackage documentation built on Dec. 23, 2021, 1:21 a.m.