Hi Nikit,

thanks for reporting - I added a test case for symbolic class labels
and it works ok (class labels get mapped to internal class ids prior
to fitting; see gradient_boosting.py:629:631) - I think the source of
the error is something different.

Can you check the dtype and shape of ``Y_1``?

It would be great if you could send me a minimal example to reproduce the error.

thanks,
 Peter

2012/7/5 Nikit Saraf <[email protected]>:
> I was trying to train a Character Recognition Model with the help of
> GradientBoostingClassifier. When i tried to run, it gave me the following
> error :-
>
> Traceback (most recent call last):
>   File "charRecog.py", line 23, in <module>
>     clf = GradientBoostingClassifier().fit(X_1,Y_1)
>   File
> "/usr/local/lib/python2.7/dist-packages/sklearn/ensemble/gradient_boosting.py",
> line 633, in fit
>     return super(GradientBoostingClassifier, self).fit(X, y)
>   File
> "/usr/local/lib/python2.7/dist-packages/sklearn/ensemble/gradient_boosting.py",
> line 439, in fit
>     self.init.fit(X, y)
>   File
> "/usr/local/lib/python2.7/dist-packages/sklearn/ensemble/gradient_boosting.py",
> line 85, in fit
>     class_counts = np.bincount(y)
> ValueError: object too deep for desired array
>
> Seeing the error, i realised it is the bincount() function which was causing
> the error as it counts only the no. of occurrences of non-negative integers
> in the array. But my labels are all strings such as 'A','e','3' etc. This
> concludes that the GradientBoostingClassifier would work only with the
> non-negative integer labels and hence would not be a universal classifier.
> So, I believe, to fix the bug, the function bincount() should be replaced
> with another function which does similar work but also universal.
>
> Please correct me if I'm wrong, as I am fairly new to Machine Learning.
>
> Regards
> Nikit Saraf
>
> ------------------------------------------------------------------------------
> 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
>



-- 
Peter Prettenhofer

------------------------------------------------------------------------------
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

Reply via email to