Ah, i see! Thanks a ton, Brian!:) I really appreciate it :)
regards,
shankar.
On Thu, Jul 19, 2012 at 6:02 PM, Brian Holt <[email protected]> wrote:
> Hi Shankar,
>
> I can reproduce your error and it turns out to be quite a subtle bug
> in your class.
>
> self.reg=RandomForestRegressor(n_estimators, max_depth,
> min_samples_split, random_state, n_jobs=1, **kwargs)
> self.clf=RandomForestClassifier(n_estimators, max_depth,
> min_samples_split, random_state,n_jobs=1, **kwargs)
>
> max_depth is given a default value of 'None' and because you're not
> using named parameters, the interpreter is using your variable
> max_depth as the criterion, which is now 'None', giving the KeyError.
>
> This code runs with no errors:
>
> self.reg=RandomForestRegressor(n_estimators=n_estimators,
> max_depth=max_depth, min_samples_split=min_samples_split,
> random_state=random_state, n_jobs=1, **kwargs)
> self.clf=RandomForestClassifier(n_estimators=n_estimators,
> max_depth=max_depth, min_samples_split=min_samples_split,
> random_state=random_state,n_jobs=1, **kwargs)
>
> Cheers
> Brian
>
> On 19 July 2012 10:41, Shankar Satish <[email protected]> wrote:
> > Sure! Here is X_train[0:5] :
> >
> > [[ 0.65179688 -0.9582746 1.04295266 -0.26265019 -0.14655937
> 1.58062601]
> > [-1.53422034 -0.9582746 1.04295266 -0.26265019 -0.14655937
> -0.31644633]
> > [ 0.65179688 1.04354227 -0.95881623 2.22137356 -0.67541134
> 0.31591111]
> > [ 0.65179688 -0.9582746 1.04295266 -0.88365614 -0.80762434
> -1.26498246]
> > [-1.53422034 -0.9582746 1.04295266 -0.88365614 0.55857652
> -0.63262504]]
> >
> > And here is Y_train[0:5] :
> >
> > array([ 0.44400001, 0.011 , 0.046 , 0.49200001, 0.078 ],
> > dtype=float32)
> >
> > Also, Y has some values = -1.0.
> >
> > regards
> > shankar.
> >
> >
> >
> >
> >
> >
> > On Thu, Jul 19, 2012 at 4:58 PM, Brian Holt <[email protected]> wrote:
> >>
> >> Hi Shankar,
> >>
> >> Can you paste a small snippet of your data (X_train, Y_train) that
> >> reproduces this behaviour?
> >>
> >> Cheers
> >> Brian
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> 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
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > 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
> >
>
>
> ------------------------------------------------------------------------------
> 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
>
------------------------------------------------------------------------------
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