Skip to main content
added 370 characters in body
Source Link
Ben Reiniger
  • 12.3k
  • 3
  • 19
  • 58

Yes. With y being a 1d array of integers (as after LabelEncoder), sklearn treats it as a multiclass classification problem. With y being a 2d binary array (as after LabelBinarizer), sklearn treats it as a multilabel problem.

Presumably, the lattermultilabel model is predicting no labels for some of the rows. (With your actual data not being multilabel, the sum of probabilities across all classes from the model will probably still be 1, so the model will never predict more than one class. And if always exactly one class gets predicted, the accuracy score for the multiclass and multilabel models should be the same.)

Yes. With y being a 1d array of integers, sklearn treats it as a multiclass classification problem. With y being a 2d binary array, sklearn treats it as a multilabel problem.

Presumably, the latter model is predicting no labels for some of the rows.

Yes. With y being a 1d array of integers (as after LabelEncoder), sklearn treats it as a multiclass classification problem. With y being a 2d binary array (as after LabelBinarizer), sklearn treats it as a multilabel problem.

Presumably, the multilabel model is predicting no labels for some of the rows. (With your actual data not being multilabel, the sum of probabilities across all classes from the model will probably still be 1, so the model will never predict more than one class. And if always exactly one class gets predicted, the accuracy score for the multiclass and multilabel models should be the same.)

Source Link
Ben Reiniger
  • 12.3k
  • 3
  • 19
  • 58

Yes. With y being a 1d array of integers, sklearn treats it as a multiclass classification problem. With y being a 2d binary array, sklearn treats it as a multilabel problem.

Presumably, the latter model is predicting no labels for some of the rows.