2
$\begingroup$

I have the simple multivariate time series looks like this,

enter image description here

Each column could be plotted in line chart as below, enter image description here

My problem statement is about is there any algorithm or machine learning to prioritize three columns based on data or charts weekly? Since each of column represents a metric(A metric, B metric and C metric), I would like to know the importance based on data without any domain knowledge and given the ranking to each one. Like feature importance but without corresponding responses. For example, A-1, B-3 and C-2.

My current possible thoughts would be,

  1. Calculate the slope from entering and ending points weekly, and given rates from 1 to end.
  2. If encountering any same values, cosine similarity determines whether two vectors are the same or not. Meaning if similarity is close to 1, two vectors are the same.

However, there are some problems using this method,

  1. If similarity is close to 0, having no other thoughts to tell which vector is more important to another.
  2. No metric to evaluate this method is a good fit or not.
  3. Not robust ways to solve this problem...

Any discussion would be appreciated as well! Thanks!

8/27- Corrected grammar New item, the background of data

The data is not generated form any video or sensor. It just happen to denote as time series data and the frequency of data are quite irregular. The data shown as above are aggregated afterwards. The characteristics of each univariate data is that there are many 0 values (i.e. sparse data). Size of original data is not quite large, usually 10 or less points per days. When I am talking about structured data is because the data source is not from any video or sensor. It more like a mark down over time. Take the 1st row as an example, each column represents how much time spending on item, A ,B and C on each date.

$\endgroup$

1 Answer 1

1
$\begingroup$

The problem with cosine similarity is that is a one-to-one alignment, that is, each value in one vector is aligned with one value in the other vector; the same holds for the Euclidean distance.

Dealing with unstructured data, such as time series, videos, audio, etc. has its shortcomings, which in general is more challenging to handle; I encourage you to read also about structured data to have a clear idea between the two philosophies. For your case, the time series case, there are other distance/similarity-based metrics such as Dynamic Time Warping (or, for brevity, DTW) which is a one-to-many alignment, and I would suggest you give it a try. DTW is very powerful and has its roots in dynamic programming; in particular, in the theory of algorithms on strings where given two strings what is the edit distance to convert one string to another, and vice versa.

Then, there is the unsupervised ranking problem that you mentioned. Ranking could be univariate (i.e., without considering any interaction among variables) or multivariate. Univariate feature selection ranking methods are easier to implement, while multivariate ones are more challenging and, in general, boil down to computing a correlation matrix between variables, which in your case are time series, that is, there is no standard methodology for doing it. My argument here is general enough so that you could grasp the idea; the discussion could go on if you need other insights.

Edit

Moreover, another issue with one-to-one alignments is that both vectors must have the same length, whereas one-to-many methods do not present such an issue.

Furthermore, a simple way to reduce the unstructured case to a structured case using the DTW approach so that you can use standard analytics is the following. Let the original dataset by a $m \times n$ matrix (i.e., $m$ rows and $n$ columns) where each entry is a time series of length, say, $N$; if the time series do not have the same length ($N$) this is a not an issue as I have already observed previously. The idea now is to construct a structured dataset which is a new $m' \times n$ matrix, where, in general, $m' \neq m$. In the degenerate case where you may have only one column, that is, the case of univariate time series, your original matrix is $m \times 1$; therefore, let $A_i$, with $1 \le i \le m$, be the $i$-th time series in such degenerate case. The goal is to construct a $\frac{m\cdot(m-1)}{2} \times 1$ matrix whose entries are computed as follows: $$ DTW(A_i, A_j) \text{ for all } 1 \le i,j \le m \text{ with } i < j. $$ Observe that, the constraint $i < j$ enforces that the resulting number of values/rows are $\frac{m \cdot (m-1)}{2}$. Now, moving from the degenerate case to the more general case where the original matrix was $m \times n$, the new matrix computed as described will be $\frac{m\cdot(m-1)}{2} \times n$ which is a matrix of real numbers, and this is sufficient to have a structured dataset. On this new matrix/dataset you can apply any unsupervised feature selection method, either univariate or multivariate, to select $n'$ features, with $n' << n$.

Finally, if your goal is to train a machine learning model, you must know that deep neural networks are the to-go strategy on unstructured data, whereas decision trees, and their siblings (e.g., random forests, grandient boosted trees) are still dominant on structured data, as this paper points out.

I hope that my edit gives you more perspective on the complexity when dealing with unstructured data.

$\endgroup$
4
  • $\begingroup$ 0xedu, thanks for your time to answer my questions. Given some info of background of data I am using now in my post. Hopefully, it would be useful. DTW is one of my consideration as well. 1. $\endgroup$
    – Max
    Aug 25, 2022 at 14:15
  • $\begingroup$ A time series is not a kind of structured data. I strongly encourage you to read about the differences between the two; otherwise, your data modeling part will inject erroneous assumptions which will eventually lead to bad prediction performances, if you plan to learn from such data. Please feel free to add more information so that I can change (or add new lines to) my answer. $\endgroup$
    – Eduard
    Aug 25, 2022 at 14:24
  • $\begingroup$ I do take DTW as my first consideration. Since the size of my data is not quite large and it has so many 0 values in each column, I decide not to use it. I do make more comments on my post, plz let me know if any unclear. Thanks for your discussion. $\endgroup$
    – Max
    Aug 25, 2022 at 14:36
  • $\begingroup$ Your English is relatively poor in the last part of your question. Please do not use words like "coz" and try to keep your English as formal as possible so we can understand your sentences; for instance, what does it mean "how to time I spend a watching"? Anyway, you keep saying that your time series is structured when it is not, and I have strongly argued this part. $\endgroup$
    – Eduard
    Aug 26, 2022 at 6:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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