Did you get an error when inputting a 1d X?
Which version of scikit-learn are you on?
X should really always be 2d. Unfortunately that is currently
inconsistent, and will be fixed soon.
On 08/18/2015 10:43 AM, Mathieu Blondel wrote:
Hi Othman,
Please send such comments to the mailing-list.
Thanks,
Mathieu
On Tue, Aug 18, 2015 at 10:03 PM, Othman Soufan
<othman.sou...@gmail.com <mailto:othman.sou...@gmail.com>> wrote:
Greetings Guys,
First of all, I want to thank you for the nice efforts you put in
this very usable case of building and training models i.e. the
case of many classes.
I came through your contributed implementation to multiclass.py in
Scikit-learn. I just have a suggestion for you to consider the
case when only one testing sample is passed to decision_function
"Decision function for the OneVsOneClassifier". As for the current
implementation, an undesirable output comes since n_samples
=X.shape[0] will take a number larger than one when X is only a
single list vector with some values. I may suggest you check the
shape of X before parsing it in a particular way, or update the
documentation to advise the user on a suggested way to get the
prediction for one testing sample.
In a sense, it is true to say that usually, there is a testing set
of many samples but in a specific case of mine, it was preferable
to predict sample by sample. I overcome this by using X[0:1,:]
instead of X[0,:] where X is a testing set of several samples.
Regards,
Othman Soufan
PhD Candidate
Mathematical and Computer Sciences and Engineering
King Abdullah University of Science and Technology
Thuwal 23955-6900
KAUST Mail Box # 2620
Kingdom of Saudi Arabia
Tel.: (+966) 506134003 <tel:%28%2B966%29%20506134003>
------------------------------------------------------------------------------
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
------------------------------------------------------------------------------
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general