Posted on 28th April 2025|371 views
Hello, While I’m working on R caret Linear Regression model. I’m trying to execute a confusion matrix and then I’m getting this below:
Error in confusionMatrix.default(pred, testing$Final): the data and reference factors must have the same number of levels.
Can anyone tell me What does it mean, Why this error occurs, and How to fix this error?