Category:Pre-processing in R: Discretization

1.) Equal sized binning - use quantiles, where the second argument is the "breaks" list > datafact <- cut(myData, quantile(myData, (0:N)/N

2.) To calculate mode use sorted frequency tables > attributeMode <- names(sort(-table(notMissing))))[1]

3) Fayyad and Irani's function in R for supervised discretization ("discretization" package):
> discretizedData <- mdlp(data)$Disc.data # Discretized data matrix > cuts <- mdlp(data)$cutp # Cut points

4) Unsupervised discretization ("infotheo" package):
> discretizedData <- discretize( data, disc="equalwidth", nbins=3 )