Weka and datetime column from MySQL DB

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

Weka and datetime column from MySQL DB

Juan Sierra Pons
Hi,

I am importing a dataset from a MySQL database to be used in the forecasting package. The forecasting package gives the following error:

java.lang.Exception: Priming instances do not appear to be in ascending order of the time stamp field (date)! 2017-01-06T00:00:00,10.52,10.54,10.52,10.53 : 2017-01-06T00:00:00,10.53,10.53,10.53,10.53

The error message makes sense as the problem I am facing is that my date column is being truncated when imported from the database.

2015-04-01 09:05:00 --------> 2015-04-01T00:00:00

On my sql client it looks like this:
date                          open            high            low            
--------------------------------------------------------------------------
2015-04-01 09:05:00   13.99           14              13.99          

On Weka's sql viewer looks like this:

2015-04-01 09:05:00.0 13.9900    14.0000    13.9900    13.9900

But once imported on the explorer it looks like this:

date                            open    high    low    close
2015-04-01T00:00:00    13.99    14.0    13.99

The datatypes I am using on my DatabaseUtils.props are
INT_UNSIGNED=5 
DECIMAL_UNSIGNED=7
INT=5      
DATETIME=8  
DATE=8  

Any Idea how to workaround this?

Thanks for your time

Best regards
--------------------------------------------------------------------------------------
Juan Sierra Pons                                 [hidden email]
Linux User Registered: #257202      
Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE
--------------------------------------------------------------------------------------

_______________________________________________
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: Weka and datetime column from MySQL DB

Juan Sierra Pons
Hi,

Finally I set DATETIME to 11 and all is OK

Best regards

--------------------------------------------------------------------------------------
Juan Sierra Pons                                 [hidden email]
Linux User Registered: #257202      
Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE
--------------------------------------------------------------------------------------

2017-01-07 21:11 GMT+01:00 Juan Sierra Pons <[hidden email]>:
Hi,

I am importing a dataset from a MySQL database to be used in the forecasting package. The forecasting package gives the following error:

java.lang.Exception: Priming instances do not appear to be in ascending order of the time stamp field (date)! 2017-01-06T00:00:00,10.52,10.54,10.52,10.53 : 2017-01-06T00:00:00,10.53,10.53,10.53,10.53

The error message makes sense as the problem I am facing is that my date column is being truncated when imported from the database.

2015-04-01 09:05:00 --------> 2015-04-01T00:00:00

On my sql client it looks like this:
date                          open            high            low            
--------------------------------------------------------------------------
2015-04-01 09:05:00   13.99           14              13.99          

On Weka's sql viewer looks like this:

2015-04-01 09:05:00.0 13.9900    14.0000    13.9900    13.9900

But once imported on the explorer it looks like this:

date                            open    high    low    close
2015-04-01T00:00:00    13.99    14.0    13.99

The datatypes I am using on my DatabaseUtils.props are
INT_UNSIGNED=5 
DECIMAL_UNSIGNED=7
INT=5      
DATETIME=8  
DATE=8  

Any Idea how to workaround this?

Thanks for your time

Best regards
--------------------------------------------------------------------------------------
Juan Sierra Pons                                 [hidden email]
Linux User Registered: #257202      
Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE
--------------------------------------------------------------------------------------


_______________________________________________
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: Weka and datetime column from MySQL DB

Eibe Frank-3
Great! Thanks for posting the solution to the list.

Cheers,
Eibe

On Wed, Jan 11, 2017 at 5:36 AM, Juan Sierra Pons <[hidden email]> wrote:
Hi,

Finally I set DATETIME to 11 and all is OK

Best regards

--------------------------------------------------------------------------------------
Juan Sierra Pons                                 [hidden email]
Linux User Registered: #257202      
Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE
--------------------------------------------------------------------------------------

2017-01-07 21:11 GMT+01:00 Juan Sierra Pons <[hidden email]>:
Hi,

I am importing a dataset from a MySQL database to be used in the forecasting package. The forecasting package gives the following error:

java.lang.Exception: Priming instances do not appear to be in ascending order of the time stamp field (date)! 2017-01-06T00:00:00,10.52,10.54,10.52,10.53 : 2017-01-06T00:00:00,10.53,10.53,10.53,10.53

The error message makes sense as the problem I am facing is that my date column is being truncated when imported from the database.

2015-04-01 09:05:00 --------> 2015-04-01T00:00:00

On my sql client it looks like this:
date                          open            high            low            
--------------------------------------------------------------------------
2015-04-01 09:05:00   13.99           14              13.99          

On Weka's sql viewer looks like this:

2015-04-01 09:05:00.0 13.9900    14.0000    13.9900    13.9900

But once imported on the explorer it looks like this:

date                            open    high    low    close
2015-04-01T00:00:00    13.99    14.0    13.99

The datatypes I am using on my DatabaseUtils.props are
INT_UNSIGNED=5 
DECIMAL_UNSIGNED=7
INT=5      
DATETIME=8  
DATE=8  

Any Idea how to workaround this?

Thanks for your time

Best regards
--------------------------------------------------------------------------------------
Juan Sierra Pons                                 [hidden email]
Linux User Registered: #257202      
Web: http://www.elsotanillo.net Git: http://www.github.com/juasiepo
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE
--------------------------------------------------------------------------------------


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