boosting for regression

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

boosting for regression

du_david
hello,

I am using adaboost for a regression problem. I tried both logit and
gentle, neither worked.

The key code is the following

    CvMat *var_type = cvCreateMat(var_count+1,1,CV_8U);
    cvSet(var_type,cvScalarAll(CV_VAR_ORDERED));
    boost.train( ls_data, CV_ROW_SAMPLE, ls_responses, 0, 0, var_type, 0,
                 CvBoostParams(CvBoost::GENTLE, 100, 0.95, 5, false, 0 ));

and the error message is

OpenCV ERROR: The function/feature is not implemented (Boosted trees
can only be used for 2-class classification.)

It seems CvBoost didn't recognize the problem as a regression problem.
The responses are real numbers of type CV_VAR_ORDERED. What else I
need to do to do regression?

Thanks in advance.

Wei


Reply | Threaded
Open this post in threaded view
|

Re: boosting for regression

get_imaginary
Maybe try random forests? (I don't know whether it's implemented there
either, but since that was Breiman's first use for RFs, it might be)

-Robin


--- In [hidden email], "du_david" <du_david@...> wrote:

>
> hello,
>
> I am using adaboost for a regression problem. I tried both logit and
> gentle, neither worked.
>
> The key code is the following
>
>     CvMat *var_type = cvCreateMat(var_count+1,1,CV_8U);
>     cvSet(var_type,cvScalarAll(CV_VAR_ORDERED));
>     boost.train( ls_data, CV_ROW_SAMPLE, ls_responses, 0, 0,
var_type, 0,
>                  CvBoostParams(CvBoost::GENTLE, 100, 0.95, 5, false,
0 ));

>
> and the error message is
>
> OpenCV ERROR: The function/feature is not implemented (Boosted trees
> can only be used for 2-class classification.)
>
> It seems CvBoost didn't recognize the problem as a regression problem.
> The responses are real numbers of type CV_VAR_ORDERED. What else I
> need to do to do regression?
>
> Thanks in advance.
>
> Wei
>


Reply | Threaded
Open this post in threaded view
|

Re: boosting for regression

du_david
I found in the doc

CvBoost::train
The train method follows the common template, the last parameter
update specifies whether the classifier needs to be updated (i.e. the
new weak tree classifiers added to the existing ensemble), or the
classifier needs to be rebuilt from scratch. The responses must be
categorical, i.e. boosted trees can not be built for regression, and
there should be 2 classes.

so that means boosting in opencv doesn't support regression? But in
the manual, regression is mentioned in the boosting section quite often.

--- In [hidden email], "Robin" <rhewitt@...> wrote:

>
> Maybe try random forests? (I don't know whether it's implemented there
> either, but since that was Breiman's first use for RFs, it might be)
>
> -Robin
>
>
> --- In [hidden email], "du_david" <du_david@> wrote:
> >
> > hello,
> >
> > I am using adaboost for a regression problem. I tried both logit and
> > gentle, neither worked.
> >
> > The key code is the following
> >
> >     CvMat *var_type = cvCreateMat(var_count+1,1,CV_8U);
> >     cvSet(var_type,cvScalarAll(CV_VAR_ORDERED));
> >     boost.train( ls_data, CV_ROW_SAMPLE, ls_responses, 0, 0,
> var_type, 0,
> >                  CvBoostParams(CvBoost::GENTLE, 100, 0.95, 5, false,
> 0 ));
> >
> > and the error message is
> >
> > OpenCV ERROR: The function/feature is not implemented (Boosted trees
> > can only be used for 2-class classification.)
> >
> > It seems CvBoost didn't recognize the problem as a regression problem.
> > The responses are real numbers of type CV_VAR_ORDERED. What else I
> > need to do to do regression?
> >
> > Thanks in advance.
> >
> > Wei
> >
>