Classification metrics can't handle a mix of continuous and multiclass targets
时间: 2024-05-25 13:11:44 浏览: 83
This error message usually occurs when you try to use a classification metric (such as accuracy, precision, recall, F1 score) on a dataset where the target variable has both continuous and multiclass values.
For example, if your target variable has values like [0, 1, 2, 3, 4, 5.4, 6.7], where the first six values represent different classes and the last two are continuous values, then you cannot use classification metrics on this dataset.
To resolve this issue, you need to either convert the continuous values to categorical values or use regression metrics instead of classification metrics. If you decide to convert the continuous values to categorical values, you can use techniques such as binning or rounding to achieve this.
阅读全文