Is it possible to use a sequence of numbers as one feature?

For example, using libsvm data format:

<label> <index1>:<value1> <index2>:<value2>

+1 1:123.02 2:1.23 3:5.45,2.22,6.76
+1 1:120.12 2:2.23 3:4.98,2.55,4.45
-1 1:199.99 2:2.13 3:4.98,2.22,6.98

Is there any special machine learning algorithm for this kind of data?

  • $\begingroup$ The format and data sample shown is likely the LIBSVM format. The first is the label (+1 or -1), followed by dimension/value pairs. This format is convenient for sparse vector storage. From the example, there might be a problem with format (I see the commas at the end). You can use LIBSVM software package on this data. $\endgroup$ – Vladislavs Dovgalecs Aug 4 '15 at 23:26

2 solutions:

  • You aggregate each sequence of numbers into a single number, which use as a feature. There exist plenty of aggregation functions, such as some derived from descriptive statistics root-mean-square, kurtosis, skewness, max, min, duration, standard deviation, crest factor, mean, or more specific aggregation such as fourier transforms or wavelet transforms.
  • You use some model that accepts sequences as input. Sequences may be of variable length. Example of such model: recurrent neural networks, Dynamic Bayesian networks.
  • 1
    $\begingroup$ @Franck Your first suggestion works fine with other type of data, but it won't capture the temporal dependence that's what makes a sequential data so unique. $\endgroup$ – horaceT Mar 5 '17 at 23:36
  • $\begingroup$ @horaceT I agree. The first solution relies on the aggregation functions, which is often not great for time series. $\endgroup$ – Franck Dernoncourt Mar 5 '17 at 23:41
  • 1
    $\begingroup$ @FranckDernoncourt Your second point is not quite accurate. RNN could deal with sequences of different length. In fact, that's what makes it work so well as a language model. $\endgroup$ – horaceT Mar 5 '17 at 23:49
  • $\begingroup$ @horaceT Good point, I'm not sure what I had in mind when writing this. Fixed! $\endgroup$ – Franck Dernoncourt Mar 6 '17 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.