Classification metrics can't handle a mix of continuous and multiclass targets
时间: 2024-05-30 16:10:33 浏览: 106
Multiclass_Classification_machineryh2g_matlab_multiclass_classif
5星 · 资源好评率100%
This error occurs when you try to use classification metrics, such as accuracy or F1 score, on a target variable that has a mix of continuous and categorical values. Classification metrics are designed to work with categorical targets, where each observation belongs to one of a fixed set of categories.
If your target variable has continuous values, you should use regression metrics instead, such as mean squared error or R-squared. If your target variable has both continuous and categorical values, you may need to perform separate analyses on the different subsets of the data.
To avoid this error, make sure that your target variable is properly formatted as either a categorical or continuous variable, depending on the type of analysis you are performing.
阅读全文