1
$\begingroup$

I am working with at data set where the goal is to predict a binary response. I have a few continuous variable that I think would be beneficial to bin. I was reading this idea about entropy based binning - http://kevinmeurer.com/a-simple-guide-to-entropy-based-discretization/. I have looked around and found entropy and infotheo - in these packages it doesn't look like the methods actually use the response to bin continuous features based on the response.

My question is how can I achieve this in R?

$\endgroup$
  • $\begingroup$ The R package logiBin can be used to bin continuous variables using the function getBins. $\endgroup$ – R3D Dec 25 '17 at 12:32
2
$\begingroup$

Why do you want to bin your continuous variables beforehand? Can't you just do logistic regression? Seems to be better suited for your problem and then you wouldn't need to discretize. Perhaps you can share a part of your data here, so we can better help you.

$\endgroup$
  • 2
    $\begingroup$ Discretization is used if you want to lose important predictive information and introduce arbitrariness into the analysis. I have trouble understanding why those are good goals to have. $\endgroup$ – Frank Harrell Apr 11 '16 at 15:57
1
$\begingroup$

The R package discretize includes the function mdlp.

The RWeka package includes the function Discretize.

Both refer to the This paper:

U. M. Fayyad and K. B. Irani (1993). Multi-interval discretization of continuous-valued attributes for classification learning. Thirteenth International Joint Conference on Artificial Intelligence, 1022–1027. Morgan Kaufmann.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.