I have a python program that makes predictions using scikit-learn RandomForestClassifier. The label is called "default" and it's the default status of a loan. This works fine.

What I need now is to extend this model, and have another label called "Prepayment Percentage" that needs to be trained using the same data as the "default" label. Ideally, the model will be trained once and the predictions will also run only once for both labels. Is this possible with RandomForestClassifier?


1 Answer 1


This would not be possible since the two variables you are trying to predict are of a different type. You are first predicting the default label, which would be yes/no, so this is a classification problem. The second variable you are trying to predict is the prepayment percentage, which is a continuous variable, this is therefore a regression problem. You are not able to combine the two (i.e. a regressor and a classifier) into one model using RandomForestClassifier. You might be able to create a single model yourself that combines the two using the BaseForest base class.

  • 1
    $\begingroup$ +1, the other thing is that even though RandomForestsClassifier of Regressors support multiple labels of the same type, behind the scenes it trains two independent models. So it doesn't learn correlations if any between labels if that was the intent. $\endgroup$ May 3, 2021 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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