[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wekalist
Subject:    Re: [Wekalist] Transforming a date (HH:mm:ss) to numeric
From:       Eibe Frank <eibe () waikato ! ac ! nz>
Date:       2019-05-17 6:00:16
Message-ID: BD11689C-85C6-4F25-874D-5B70CB2D7DDE () waikato ! ac ! nz
[Download RAW message or body]

$ cat test.arff

@relation dateTest
@attribute duration date HH:mm:ss
@attribute whatever {good, bad}

@data
07:15:00, bad
12:00:00, bad
01:30:00, good
04:45:00, good
02:45:00, good

$ java weka.Run .DateToNumeric -i test.arff | java weka.Run .MathExpression -E \
"(12*3600000+A)/3600000" -R 1 -V

@relation dateTest-weka.filters.unsupervised.attribute.DateToNumeric-Rfirst-last-weka.filters.unsupervised.attribute.MathExpression-E(12*3600000+A)/3600000-V-R1


@attribute duration numeric
@attribute whatever {good,bad}

@data

7.25,bad
12,bad
1.5,good
4.75,good
2.75,good


> On 17/05/2019, at 2:29 AM, C. Peter <c.peter@bioartproducts.de> wrote:
> 
> Hi all,
> 
> in my dataset I have a "duration" attribute given as date in the form
> HH:mm:ss.
> 
> To make it usable for classification, I would like to transform it into
> a numeric. I tried the weka.filters.unsupervised.attribute.DateToNumeric
> filter, but it does not produce the wanted result (according to its
> description it gives me the milliseconds since 01/01/1970 which is not
> of much use to me).
> 
> So what I have is something like
> 
> @relation dateTest
> @attribute duration date HH:mm:ss
> @attribute whatever {good, bad}
> 
> @data
> 07:15:00, bad
> 12:00:00, bad
> 01:30:00, good
> 04:45:00, good
> 02:45:00, good
> 
> What i would like to get out of the transformation is something like
> 
> @relation dateTestTransformed
> @attribute duration numeric
> @attribute whatever {good, bad}
> 
> @data
> 07.25, bad
> 12.00, bad
> 01.50, good
> 04.75, good
> 02.75, good
> 
> or something in this direction. I just want to be able to include the
> duration of an interval into my analysis.
> 
> What would you suggest?
> 
> Thanks a lot,
> 
> Christian
> 
> 
> 
> _______________________________________________
> Wekalist mailing list
> Send posts to: Wekalist@list.waikato.ac.nz
> To subscribe, unsubscribe, etc., visit \
> 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: Wekalist@list.waikato.ac.nz
To subscribe, unsubscribe, etc., visit \
https://list.waikato.ac.nz/mailman/listinfo/wekalist List etiquette: \
http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic