Don't do this, as it particularly doesn't make sense for a random forest model. In addition to the many reasons that categorizing a continuous predictor is a bad idea, it undercuts a potential strength of a random forest: its ability to find unsuspected interactions among predictors in a model.
With a random forest, the association of one predictor with outcome can thus depend on the values of other predictors. Any cutoffs you might choose would thus necessarily depend on the values of other predictors. Why not just use the full model to make predictions as needed?
In response to comment
The above applies to post-modeling cutoffs, as constructing the random forest already involves making multiple cutoffs of each continuous-predictor value. At lower branches of each of the many trees that are built, the choice of cutoff for one predictor will depend on the values chosen for all the predictors used at higher levels of that tree. After the model is built there will be no one cutoff for any continuous predictor that is independent of the values of the other predictors.
This is even the case for simple standard regression models that contain simple interaction terms. For example, if the effect of one continuous variable (e.g., age
) depends on another (e.g., hemoglobin A1C
) in an interaction term, then you would have to change the cutoff for age
depending on the value of hemoglobin A1C
.
A clinician is presumably interested in the probability of developing the disease. That depends on combinations of values of all the predictors. You can make probability predictions from a properly constructed random forest, based on each new patient's values.
Even if a clinician and patient might then choose some probability cutoff based on the relative costs of false-positive and false-negative assessments, that probability will depend on (usually unknowable, with a random forest) combinations of all the predictors that were identified during model construction.