You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LabelBinarizer returns dense output when input has only a single label even when sparse_output is set to True #6202
changed the title [-]LabelBinarizer returns dense output when input has only a single label sparse_output is set to True[/-][+]LabelBinarizer returns dense output when input has only a single label even when sparse_output is set to True[/+]on Jan 20, 2016
@MechCoder can I try this? In the case of len(classes)==1 it never checks for sparse_output so I tried adding a condition there but as expected it will return a (5,1) empty sparse array in this case. What kind of output is desired for this? Should I append a 0 or 1 to classes and pass it down?
Activity
[-]LabelBinarizer returns dense output when input has only a single label sparse_output is set to True[/-][+]LabelBinarizer returns dense output when input has only a single label even when sparse_output is set to True[/+]Fixed OvO for issue scikit-learn#6203.
devashishd12 commentedon Jan 22, 2016
@MechCoder can I try this? In the case of
len(classes)==1it never checks forsparse_outputso I tried adding a condition there but as expected it will return a (5,1) empty sparse array in this case. What kind of output is desired for this? Should I append a 0 or 1 to classes and pass it down?MechCoder commentedon Jan 24, 2016
It seems even the dense case it is broken. IMO it should return a 1-D array with each sample encoded with
pos_labelFixed OvO for issue scikit-learn#6203.