On Fri, May 18, 2012 at 12:50:11PM +0900, Mathieu Blondel wrote: > On Fri, May 18, 2012 at 6:39 AM, Ian Goodfellow > <[email protected]>wrote: > > > If the class label vector passed to the "fit" method of > > OneVsRestClassifier has shape (n,1) instead of shape (n,), > > then really weird results happen. In this example script here, when > > the fit SVM is asked to predict the labels of > > 1000 examples, the resulting prediction vector has shape (45000,1), > > not (1000,) as expected. > > > > Thanks for reporting. I could reproduce the problem. So the "issue" seems > to be in LabelBinarizer. To fix this, I suggest that we just raise an error > in LabelBinarizer when the input to fit has 2d shape.
Just checking: presumably it should raise an error if it's anything greater than 1d? Also, it might be good to check that arr.dtype.kind == 'i', or maybe one of 'i' or 'b' (it'd be kind of stupid to call LabelBinarizer on boolean labels, but presumably it should just be a no-op in that case). David ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Scikit-learn-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
