TSF and SMOreg: "Cannot handle date attributes!"

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

TSF and SMOreg: "Cannot handle date attributes!"

thorsten123
Hi there,

I am trying to use the WekaForecaster from the timeseriesforecasting Package within my java project for time series prediction. Accordingly, the class attribute of my dataset is a date attribute. I want to use SMOreg as base classifier. When I do the forecasting in the Weka Explorer, everything works fine and I get valid results. But as I try to do the forecasting in my own application I get the exception "Cannot handle date attributes!". I guess, there has to be a converting/filtering of the data before the SMOreg can work with it. So what can I do by working with the Java API?

I highly appreciate any help, thank you very much in advance.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TSF and SMOreg: "Cannot handle date attributes!"

Mark Hall
Actually, I wasn't aware that it worked when the target was a date attribute :-) You might need to post your data and code so that we can take a look.

Cheers,
Mark.

On 31/07/17, 3:07 AM, "thorsten123" <[hidden email] on behalf of [hidden email]> wrote:

    Hi there,
   
    I am trying to use the WekaForecaster from the /timeseriesforecasting/
    Package within my java project for time series prediction. Accordingly, the
    class attribute of my dataset is a date attribute. I want to use /SMOreg/ as
    base classifier. When I do the forecasting in the Weka Explorer, everything
    works fine and I get valid results. But as I try to do the forecasting in my
    own application I get the exception "Cannot handle date attributes!". I
    guess, there has to be a converting/filtering of the data before the SMOreg
    can work with it. So what can I do by working with the Java API?
   
    I highly appreciate any help, thank you very much in advance.
   
   
   
    --
    View this message in context: http://weka.8497.n7.nabble.com/TSF-and-SMOreg-Cannot-handle-date-attributes-tp41351.html
    Sent from the WEKA mailing list archive at Nabble.com.
    _______________________________________________
    Wekalist mailing list
    Send posts to: [hidden email]
    List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
    List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
   


_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TSF and SMOreg: "Cannot handle date attributes!"

thorsten123
Dear Mark,

thank you for your reply. In the Weka Explorer it worked while the target was not a date attribute. The data structure is the following:

@attribute timestamp date 'yyyy-MM-dd HH:mm'
@attribute attributeX numeric
@attribute attributeY numeric
@attribute attributeZ numeric

My code is the following:

                this.forecaster = new WekaForecaster();
                this.forecaster.setBaseForecaster(new SMOreg());
                this.forecaster.buildForecaster(this.trainingSet, System.out);
                this.forecaster.primeForecaster(this.trainingSet);

->
weka.core.UnsupportedAttributeTypeException: weka.classifiers.functions.SMOreg: Cannot handle date attributes!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TSF and SMOreg: "Cannot handle date attributes!"

Mark Hall
Right, that was what I expected. A number of Weka classifiers do not accept date attributes as inputs, and the way the time series forecasting data preprocessing works is that it creates time-lagged versions of the target attribute.

Cheers,
Mark.

On 31/07/17, 10:48 AM, "thorsten123" <[hidden email] on behalf of [hidden email]> wrote:

    Dear Mark,
   
    thank you for your reply. In the Weka Explorer it worked while the target
    was not a date attribute. The data structure is the following:
   
    @attribute timestamp date 'yyyy-MM-dd HH:mm'
    @attribute attributeX numeric
    @attribute attributeY numeric
    @attribute attributeZ numeric
   
    My code is the following:
   
    this.forecaster = new WekaForecaster();
    this.forecaster.setBaseForecaster(new SMOreg());
    this.forecaster.buildForecaster(this.trainingSet, System.out);
    this.forecaster.primeForecaster(this.trainingSet);
   
    ->
    weka.core.UnsupportedAttributeTypeException:
    weka.classifiers.functions.SMOreg: Cannot handle date attributes!
   
   
   
   
    --
    View this message in context: http://weka.8497.n7.nabble.com/TSF-and-SMOreg-Cannot-handle-date-attributes-tp41351p41358.html
    Sent from the WEKA mailing list archive at Nabble.com.
    _______________________________________________
    Wekalist mailing list
    Send posts to: [hidden email]
    List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
    List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
   


_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TSF and SMOreg: "Cannot handle date attributes!"

thorsten123
Am I correct that this does mean, I just have to transform the date attribute in a numeric one and can determine an appropriate result?

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: TSF and SMOreg: "Cannot handle date attributes!"

Eibe Frank-2
Administrator
Yes, that should work.

Cheers,
Eibe

> On 31/07/2017, at 11:12 AM, thorsten123 <[hidden email]> wrote:
>
> Am I correct that this does mean, I just have to transform the date attribute
> in a numeric one and can determine an appropriate result?
>
> Thanks in advance.
>
>
>
> --
> View this message in context: http://weka.8497.n7.nabble.com/TSF-and-SMOreg-Cannot-handle-date-attributes-tp41351p41361.html
> Sent from the WEKA mailing list archive at Nabble.com.
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Loading...