# Why does not R Chi2 algorithm discretize in the same manner as in the paper by Liu and Setiono?

As stated in R documentation (discretization - R (from CRAN)), R package discretizion offers the function Chi2, which comes to life in the following papers:

Liu, H. and Setiono, R. (1995). Chi2: Feature selection and discretization of numeric attributes, Tools with Artificial Intelligence, 388–391.

Liu, H. and Setiono, R. (1997). Feature selection and discretization, IEEE transactions on knowledge and data engineering, Vol.9, no.4, 642–645.

I wrote the following R programming language code, in which I have set alpha and delta equal to the ones set in the papers above. Finally, the following code prints out the discretized dataframe. I used Iris dataframe, as in one of the examples in the two papers.

library(discretization)
data(iris)
df1 <- iris[FALSE,]
for(i in 1:nrow(iris)){
if(i %% 2 != 0){
df1 <- rbind(df1, iris[i,])
}
}
chi2(df1, alp=0.5, del=0.05)\$Disc.data


The two papers above state that, with alfa = 0.5 and delta = 5%, and that "the originally odd numbered data are selected for training (75 patterns) and rest for testing (75 patterns)". Iris attributes selected are only two. The point is that, observing the dataframe printed out by the last instruction, you can see that no attribute is removed. The discretized data frame still have 4 attributes discretized: if I correctly understood the above papers, Sepal Length and Sepal Width should have been both discretized in just one interval by Chi2 algorithm.

• General suggestion without knowing the details in such cases is: first read the documentation carefully if any deviations from the original procedure are noted/explained. If not, contact the package's maintainer. Nov 23 '16 at 14:27
• Thank you. I didn't find explicit signals of deviations from original procedure, so that I wrote to the package's mainainer. I hope he will be not too much busy Nov 23 '16 at 16:56
• I think this question will be a tumbleweed, unfortunately Nov 23 '16 at 16:57
• Seems to be a cross-post to r-help: stat.ethz.ch/pipermail/r-help/2016-November/443356.html Nov 23 '16 at 20:07
• I wrote that post, after ayone didn't reply here, @Helix123 Nov 24 '16 at 10:13