Converting univariate time series data for time series classification with WEKA

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

Converting univariate time series data for time series classification with WEKA

Eibe Frank-2
Administrator
For time series classification, WEKA has a timeSeriesFilters package that provides the well-known SAX transformation to convert a numeric time series into a sequence of characters so that text classification techniques can be applied. However, the SAX filter expects the time series data to be provided in a relation-valued attribute, which is different from the format used by the time series repository at

  http://timeseriesclassification.com/dataset.php

The relation-valued format looks expected by the SAX filter looks like this:

@relation my_data
@attribute my_series relational
@attribute value numeric
@end my_series
@attribute class {p,n}
@data
"5.5\n5.7",p
"6.7\n8.1\n9.1",n

Below, I have appended a Groovy script for data conversion that can be run in the Groovy console available via the Tools menu in WEKA's GUIChooser (if the kfGroovy package has been installed). It takes an input file in the format provided by the above repository and converts it into the format acceptable to the SAX filter (the file names in the script need to be adjusted appropriately). It is then possible to run the FilteredClassifier with the StringToWordVector filter on the data (using the CharacterNGramTokenizer). An example classifier configuration that can be pasted into WEKA's Classify panel is

weka.classifiers.meta.FilteredClassifier -F "weka.filters.MultiFilter -F \"weka.filters.unsupervised.timeseries.SAXTransformer -R 1 -A 20\" -F \"weka.filters.unsupervised.timeseries.OneDimensionalTimeSeriesToString -R 1\" -F \"weka.filters.unsupervised.attribute.StringToWordVector -R first-last -W 1000 -prune-rate -1.0 -C -N 0 -stemmer weka.core.stemmers.NullStemmer -stopwords-handler weka.core.stopwords.Null -M 1 -tokenizer \\\"weka.core.tokenizers.CharacterNGramTokenizer -max 3 -min 1\\\"\"" -S 1 -W weka.classifiers.trees.RandomForest -- -P 100 -I 100 -num-slots 1 -K 0 -M 1.0 -V 0.001 -S 1

Cheers,
Eibe

// Load data with one numeric univariate time series + a nominal class value per instance
data = weka.core.converters.ConverterUtils.DataSource.read("/Users/eibe/datasets/TSC Problems/Adiac/Adiac.arff")

// Number of values per time series, assuming the class attribute is the last attribute in the data
numValues = data.numAttributes() - 1

// In the following, we assume the class attribute is the last attribute in the data we have read
attributesForInnerRelation = new ArrayList<weka.core.Attribute>()
attributesForInnerRelation.add(new weka.core.Attribute("time_series_values"))
attributes = new ArrayList<weka.core.Attribute>()
innerRelation = new weka.core.Instances("time_series", attributesForInnerRelation, 0)
attributes.add(new weka.core.Attribute("time_series", innerRelation))
attributes.add(data.attribute(data.numAttributes() - 1).copy())
transformedData = new weka.core.Instances(data.relationName() + "_transformed", attributes, data.numInstances())
for (inst in data) {
  sequenceData = new weka.core.Instances(innerRelation, numValues)
  for (int i = 0; i < numValues; i++) {
    vals = new double[1]
    vals[0] = inst.value(i)
    sequenceData.add(new weka.core.DenseInstance(1.0, vals))
  }
  newVals = new double[2]
  newVals[0] = transformedData.attribute(0).addRelation(sequenceData)
  newVals[1] = inst.value(numValues)
  transformedData.add(new weka.core.DenseInstance(1.0, newVals))
}
weka.core.converters.ConverterUtils.DataSink.write("/Users/eibe/datasets/TSC Problems/Adiac/Adiac_transformed.arff", transformedData)

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

Re: Converting univariate time series data for time series classification with WEKA

alex_limzhin
Good day sir, I want to ask whether I have to convert the ARFF file to the
following relation-valued format that you specified above before I proceed
to the filtering process? Now I have a rainfall dataset which consist of:

@relation s1
@attribute Time {'01-01-14 0:00','01-01-14 0:05','01-01-14 0:10'}
@attribute 'Rainfall (mm)' numeric
@data
'01-01-14 0:00',934.10004
'01-01-14 0:05',934.10004
'01-01-14 0:10',934.10004

How to I convert it to relation format? Thanks in advanced!


Eibe Frank-2 wrote

> For time series classification, WEKA has a timeSeriesFilters package that
> provides the well-known SAX transformation to convert a numeric time
> series
> into a sequence of characters so that text classification techniques can
> be
> applied. However, the SAX filter expects the time series data to be
> provided in a relation-valued attribute, which is different from the
> format
> used by the time series repository at
>
>   http://timeseriesclassification.com/dataset.php
>
> The relation-valued format looks expected by the SAX filter looks like
> this:
>
> @relation my_data
> @attribute my_series relational
> @attribute value numeric
> @end my_series
> @attribute class {p,n}
> @data
> "5.5\n5.7",p
> "6.7\n8.1\n9.1",n
>
> Below, I have appended a Groovy script for data conversion that can be run
> in the Groovy console available via the Tools menu in WEKA's GUIChooser
> (if
> the kfGroovy package has been installed). It takes an input file in the
> format provided by the above repository and converts it into the format
> acceptable to the SAX filter (the file names in the script need to be
> adjusted appropriately). It is then possible to run the FilteredClassifier
> with the StringToWordVector filter on the data (using the
> CharacterNGramTokenizer). An example classifier configuration that can be
> pasted into WEKA's Classify panel is
>
> weka.classifiers.meta.FilteredClassifier -F "weka.filters.MultiFilter -F
> \"weka.filters.unsupervised.timeseries.SAXTransformer -R 1 -A 20\" -F
> \"weka.filters.unsupervised.timeseries.OneDimensionalTimeSeriesToString -R
> 1\" -F \"weka.filters.unsupervised.attribute.StringToWordVector -R
> first-last -W 1000 -prune-rate -1.0 -C -N 0 -stemmer
> weka.core.stemmers.NullStemmer -stopwords-handler weka.core.stopwords.Null
> -M 1 -tokenizer \\\"weka.core.tokenizers.CharacterNGramTokenizer -max 3
> -min 1\\\"\"" -S 1 -W weka.classifiers.trees.RandomForest -- -P 100 -I 100
> -num-slots 1 -K 0 -M 1.0 -V 0.001 -S 1
>
> Cheers,
> Eibe
>
> // Load data with one numeric univariate time series + a nominal class
> value per instance
> data =
> weka.core.converters.ConverterUtils.DataSource.read("/Users/eibe/datasets/TSC
> Problems/Adiac/Adiac.arff")
>
> // Number of values per time series, assuming the class attribute is the
> last attribute in the data
> numValues = data.numAttributes() - 1
>
> // In the following, we assume the class attribute is the last attribute
> in
> the data we have read
> attributesForInnerRelation = new ArrayList
> <weka.core.Attribute>
> ()
> attributesForInnerRelation.add(new
> weka.core.Attribute("time_series_values"))
> attributes = new ArrayList
> <weka.core.Attribute>
> ()
> innerRelation = new weka.core.Instances("time_series",
> attributesForInnerRelation, 0)
> attributes.add(new weka.core.Attribute("time_series", innerRelation))
> attributes.add(data.attribute(data.numAttributes() - 1).copy())
> transformedData = new weka.core.Instances(data.relationName() +
> "_transformed", attributes, data.numInstances())
> for (inst in data) {
>   sequenceData = new weka.core.Instances(innerRelation, numValues)
>   for (int i = 0; i < numValues; i++) {
>     vals = new double[1]
>     vals[0] = inst.value(i)
>     sequenceData.add(new weka.core.DenseInstance(1.0, vals))
>   }
>   newVals = new double[2]
>   newVals[0] = transformedData.attribute(0).addRelation(sequenceData)
>   newVals[1] = inst.value(numValues)
>   transformedData.add(new weka.core.DenseInstance(1.0, newVals))
> }
> weka.core.converters.ConverterUtils.DataSink.write("/Users/eibe/datasets/TSC
> Problems/Adiac/Adiac_transformed.arff", transformedData)
>
> _______________________________________________
> Wekalist mailing list
> Send posts to:

> Wekalist@.ac

> 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





--
Sent from: http://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Converting univariate time series data for time series classification with WEKA

Eibe Frank-2
Administrator
If you make sure that all the values associated with the same time series get the same nominal attribute value, you can use the PropositionalToMultiInstance filter from the multiInstanceFilters package to get your data into relational format.

Input:

@relation s1
@attribute Date {01-01-14}
@attribute 'Rainfall (mm)' numeric
@data
'01-01-14',934.10004
'01-01-14',934.10004
'01-01-14’,934.10004

Output:

@relation s1-weka.filters.unsupervised.attribute.PropositionalToMultiInstance-S1-Bfirst

@attribute Date {01-01-14}
@attribute bag relational
@attribute 'Rainfall (mm)' numeric
@end bag

@data

01-01-14,'934.10004\n934.10004\n934.10004',{3}

Assuming this output is stored in a file called train.relational.arff, you can then run something like this (command-line version):

java weka.Run .SAXTransformer -R 2 <  train.relational.arff | java weka.Run  OneDimensionalTimeSeriesToString -R 2

Now, the time series will be represented as a string, generated using the SAX algorithm, and further processing is possible using the StringToWordVector filter.

Cheers,
Eibe


> On 11/11/2018, at 9:17 PM, alex_limzhin <[hidden email]> wrote:
>
> Good day sir, I want to ask whether I have to convert the ARFF file to the
> following relation-valued format that you specified above before I proceed
> to the filtering process? Now I have a rainfall dataset which consist of:
>
> @relation s1
> @attribute Time {'01-01-14 0:00','01-01-14 0:05','01-01-14 0:10'}
> @attribute 'Rainfall (mm)' numeric
> @data
> '01-01-14 0:00',934.10004
> '01-01-14 0:05',934.10004
> '01-01-14 0:10',934.10004
>
> How to I convert it to relation format? Thanks in advanced!
>
>
> Eibe Frank-2 wrote
>> For time series classification, WEKA has a timeSeriesFilters package that
>> provides the well-known SAX transformation to convert a numeric time
>> series
>> into a sequence of characters so that text classification techniques can
>> be
>> applied. However, the SAX filter expects the time series data to be
>> provided in a relation-valued attribute, which is different from the
>> format
>> used by the time series repository at
>>
>>  http://timeseriesclassification.com/dataset.php
>>
>> The relation-valued format looks expected by the SAX filter looks like
>> this:
>>
>> @relation my_data
>> @attribute my_series relational
>> @attribute value numeric
>> @end my_series
>> @attribute class {p,n}
>> @data
>> "5.5\n5.7",p
>> "6.7\n8.1\n9.1",n
>>
>> Below, I have appended a Groovy script for data conversion that can be run
>> in the Groovy console available via the Tools menu in WEKA's GUIChooser
>> (if
>> the kfGroovy package has been installed). It takes an input file in the
>> format provided by the above repository and converts it into the format
>> acceptable to the SAX filter (the file names in the script need to be
>> adjusted appropriately). It is then possible to run the FilteredClassifier
>> with the StringToWordVector filter on the data (using the
>> CharacterNGramTokenizer). An example classifier configuration that can be
>> pasted into WEKA's Classify panel is
>>
>> weka.classifiers.meta.FilteredClassifier -F "weka.filters.MultiFilter -F
>> \"weka.filters.unsupervised.timeseries.SAXTransformer -R 1 -A 20\" -F
>> \"weka.filters.unsupervised.timeseries.OneDimensionalTimeSeriesToString -R
>> 1\" -F \"weka.filters.unsupervised.attribute.StringToWordVector -R
>> first-last -W 1000 -prune-rate -1.0 -C -N 0 -stemmer
>> weka.core.stemmers.NullStemmer -stopwords-handler weka.core.stopwords.Null
>> -M 1 -tokenizer \\\"weka.core.tokenizers.CharacterNGramTokenizer -max 3
>> -min 1\\\"\"" -S 1 -W weka.classifiers.trees.RandomForest -- -P 100 -I 100
>> -num-slots 1 -K 0 -M 1.0 -V 0.001 -S 1
>>
>> Cheers,
>> Eibe
>>
>> // Load data with one numeric univariate time series + a nominal class
>> value per instance
>> data =
>> weka.core.converters.ConverterUtils.DataSource.read("/Users/eibe/datasets/TSC
>> Problems/Adiac/Adiac.arff")
>>
>> // Number of values per time series, assuming the class attribute is the
>> last attribute in the data
>> numValues = data.numAttributes() - 1
>>
>> // In the following, we assume the class attribute is the last attribute
>> in
>> the data we have read
>> attributesForInnerRelation = new ArrayList
>> <weka.core.Attribute>
>> ()
>> attributesForInnerRelation.add(new
>> weka.core.Attribute("time_series_values"))
>> attributes = new ArrayList
>> <weka.core.Attribute>
>> ()
>> innerRelation = new weka.core.Instances("time_series",
>> attributesForInnerRelation, 0)
>> attributes.add(new weka.core.Attribute("time_series", innerRelation))
>> attributes.add(data.attribute(data.numAttributes() - 1).copy())
>> transformedData = new weka.core.Instances(data.relationName() +
>> "_transformed", attributes, data.numInstances())
>> for (inst in data) {
>>  sequenceData = new weka.core.Instances(innerRelation, numValues)
>>  for (int i = 0; i < numValues; i++) {
>>    vals = new double[1]
>>    vals[0] = inst.value(i)
>>    sequenceData.add(new weka.core.DenseInstance(1.0, vals))
>>  }
>>  newVals = new double[2]
>>  newVals[0] = transformedData.attribute(0).addRelation(sequenceData)
>>  newVals[1] = inst.value(numValues)
>>  transformedData.add(new weka.core.DenseInstance(1.0, newVals))
>> }
>> weka.core.converters.ConverterUtils.DataSink.write("/Users/eibe/datasets/TSC
>> Problems/Adiac/Adiac_transformed.arff", transformedData)
>>
>> _______________________________________________
>> Wekalist mailing list
>> Send posts to:
>
>> Wekalist@.ac
>
>> 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
>
>
>
>
>
> --
> Sent from: http://weka.8497.n7.nabble.com/
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> 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: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Converting univariate time series data for time series classification with WEKA

alex_limzhin
In reply to this post by alex_limzhin
I swap the class as the last attribute according to the script given but it
gives the output as below:

@relation rainfall1mswap_transformed
@attribute time_series relational
@attribute time_series_values numeric
@end time_series
@attribute Time {"01-01-14 0:00","01-01-14 0:05","01-01-14 0:10"
@data
934.10004,"01-01-14 0:00"
934.10004,"01-01-14 0:05"
934.10004,"01-01-14 0:10"

It seems different from your output :
> @data
> "5.5\n5.7",p
> "6.7\n8.1\n9.1",n

how do i solve this problem?



--
Sent from: http://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Converting univariate time series data for time series classification with WEKA

Eibe Frank-3
To make PrositionalToMultiinstance apply correctly in your case, you need to have exactly the same value of the Time attribute for each element of a time series.

This is all assuming that you want to perform time series classification (or regression), where we want to predict a single label for an entire series.

If time series forecasting is what you actually want to do, forget all this stuff about relational attributes and instead take a look at the material for the first class of the Advanced Data Mining with Weka MOOC.

Cheers,
Eibe

On Wed, 14 Nov 2018 at 11:11 PM, alex_limzhin <[hidden email]> wrote:
I swap the class as the last attribute according to the script given but it
gives the output as below:

@relation rainfall1mswap_transformed
@attribute time_series relational
@attribute time_series_values numeric
@end time_series
@attribute Time {"01-01-14 0:00","01-01-14 0:05","01-01-14 0:10"
@data
934.10004,"01-01-14 0:00"
934.10004,"01-01-14 0:05"
934.10004,"01-01-14 0:10"

It seems different from your output :
> @data
> "5.5\n5.7",p
> "6.7\n8.1\n9.1",n

how do i solve this problem?



--
Sent from: http://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
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: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Converting univariate time series data for time series classification with WEKA

alex_limzhin
Yes I do want to have classification on my univariate time series but I have
problem in changing my series into relation-valued

@relation rainfall
@attribute Time {01-01-14,02-01-14,03-01-14,04-01-14}
@attribute mm numeric

@data
01-01-14,934
01-01-14,945
02-01-14,933
02-01-14,923
03-01-14,933
04-01-14,932

When I undergo PropositionalToMultiInstance filter, it give output like:

@relation
rainfall-weka.filters.unsupervised.attribute.PropositionalToMultiInstance-S1-B1
@attribute Time {01-01-14,02-01-14,03-01-14,04-01-14}
@attribute bag relational
@end bag
@attribute mm numeric
@data

01-01-14,'\n',934,{2}
02-01-14,'\n',933,{2}
03-01-14,'',933
04-01-14,'',932

it doesn't show the corresponding value inside the ' ' and some value is
missing. Anything wrong with this?






--
Sent from: http://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Converting univariate time series data for time series classification with WEKA

Eibe Frank-2
Administrator
Hmm, that is peculiar. I have tried to reproduce this problem using the system CLI (as well as WEKA’s SimpleCLI) on macOS, Linux, and Windows 10, with WEKA 3.8.3, and it generated the correct output in all cases.

How exactly are you applying the filter?

Cheers,
Eibe


> On 19/11/2018, at 6:40 AM, alex_limzhin <[hidden email]> wrote:
>
> Yes I do want to have classification on my univariate time series but I have
> problem in changing my series into relation-valued
>
> @relation rainfall
> @attribute Time {01-01-14,02-01-14,03-01-14,04-01-14}
> @attribute mm numeric
>
> @data
> 01-01-14,934
> 01-01-14,945
> 02-01-14,933
> 02-01-14,923
> 03-01-14,933
> 04-01-14,932
>
> When I undergo PropositionalToMultiInstance filter, it give output like:
>
> @relation
> rainfall-weka.filters.unsupervised.attribute.PropositionalToMultiInstance-S1-B1
> @attribute Time {01-01-14,02-01-14,03-01-14,04-01-14}
> @attribute bag relational
> @end bag
> @attribute mm numeric
> @data
>
> 01-01-14,'\n',934,{2}
> 02-01-14,'\n',933,{2}
> 03-01-14,'',933
> 04-01-14,'',932
>
> it doesn't show the corresponding value inside the ' ' and some value is
> missing. Anything wrong with this?
>
>
>
>
>
>
> --
> Sent from: http://weka.8497.n7.nabble.com/
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> 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: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Converting univariate time series data for time series classification with WEKA

alex_limzhin
Im using the WEKA GUI to apply the filter.
Open file > Choose filter > PropositionalToMultiInstance -S 1 -B first >
Apply
Seems like the @attribute mm numeric is not in between @attribute bag
relational and @end bag

Any filter do I need to apply before I apply the filter above?




--
Sent from: http://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Converting univariate time series data for time series classification with WEKA

Eibe Frank-2
Administrator
OK, I can reproduce this bug in the Explorer. The reason that the bug is triggered in the Explorer is that the Explorer automatically treats the last attribute in the data as the class attribute.

To work around the bug, specify “No class” rather than "Class: mm (Num)” in the Preprocess panel before you run the filter.

Cheers,
Eibe

> On 19/11/2018, at 4:26 PM, alex_limzhin <[hidden email]> wrote:
>
> Im using the WEKA GUI to apply the filter.
> Open file > Choose filter > PropositionalToMultiInstance -S 1 -B first >
> Apply
> Seems like the @attribute mm numeric is not in between @attribute bag
> relational and @end bag
>
> Any filter do I need to apply before I apply the filter above?
>
>
>
>
> --
> Sent from: http://weka.8497.n7.nabble.com/
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> 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: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Converting univariate time series data for time series classification with WEKA

alex_limzhin
This post was updated on .
It generates the correct output but with the weight behind, Im found that timeseries filter will be grayed-out. So what am I doing is set the propositionaltomultiinstance filter options : doNotWeightBags to True
>@relation rainfall-weka.filters.unsupervised.attribute.PropositionalToMultiInstance-S1-Bfirst-no-weights


@attribute Time {01-01-14,02-01-14,03-01-14,04-01-14}
@attribute bag relational
@attribute mm numeric
@end bag
@data
01-01-14,'934\n945'
02-01-14,'933\n923'
03-01-14,933
04-01-14,932

so that it won't generate the weight for each set of data and the timeseries filters are not grayed-out.
After I implement the sax transformation filter, no transformation is happen instead of blank data.
>weka.filters.unsupervised.timeseries.SAXTransformer -R 2 -A 5


--
Sent from: http://weka.8497.n7.nabble.com/
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Converting univariate time series data for time series classification with WEKA

Eibe Frank-2
Administrator
By default, PropositionalToMultiInstance weights each example by the number of instances in its bag, but SAXTransformer does not implement WeightedInstancesHandler so it cannot process example weights.

There is an option in PropositionalToMultiInstance that turns off example weights. If you use that option, you will be able to apply SAXTransformer.

Unfortunately, there appears to be another weird bug and the SAXTransformer outputs 0 instances as a consequence of this bug. This bug does not occur if you save the data to a file after applying PropositionalToMultiInstance, load it back in, and then apply SAXTransformer…

Cheers,
Eibe

> On 19/11/2018, at 4:49 PM, alex_limzhin <[hidden email]> wrote:
>
> It generated the correct output! But when I proceed to the next step which is
> PAA and SAX transformation, the options for SAX and PAA is grayed out, how
> to solve this problem?
>
>
>
> --
> Sent from: http://weka.8497.n7.nabble.com/
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> 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: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Converting univariate time series data for time series classification with WEKA

alex_limzhin
I have successfully finish my steps till the StringToWordVector, for the
classification process, I cant get the data correctly classified using MLP,
SVM and J48, it is due to my univariate data or what should I filter to get
the best result for classification?



--
Sent from: http://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Converting univariate time series data for time series classification with WEKA

Eibe Frank-2
Administrator
So classification works but accuracy is too low?

Not sure whether I mentioned that it is essential to switch to the CharacterNGramTokenizer in StringToWordVector. OneDimensionalTimeSeriesToString will just return one long string without any whitespace, so tokenisation needs to be performed on the basis of character n-grams.

Cheers,
Eibe

> On 21/11/2018, at 4:29 PM, alex_limzhin <[hidden email]> wrote:
>
> I have successfully finish my steps till the StringToWordVector, for the
> classification process, I cant get the data correctly classified using MLP,
> SVM and J48, it is due to my univariate data or what should I filter to get
> the best result for classification?
>
>
>
> --
> Sent from: http://weka.8497.n7.nabble.com/
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> 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: [hidden email]
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