I would like to cluster multidimensional time series using k-means and Ward's method. My base dataset has 4 columns (features) and each of them is a time series of 288 values. So one "datapoint" has $4*288=1152$ entries (dimensions). I have 100 datapoints that I want to cluster.

Depending on the setup, it might be possible that 1 or 2 of the 4 columns have 0 values for 288 time series values and for all of the 100 datapoints that I want to cluster. Now my question is, if and how these 0-columns affect the results of the clustering with k-means and Ward's method? So let's say that actually one datapoint has only 2 features with 288 values. Does it make a difference if I use $2*288=576$ dimensions for one record compared to using $4*288=1152$ dimensions for one record when out of the 4 dimensions in the big array 2 have 0-values for all entries?

  • $\begingroup$ How is your data represented? I mean, you have a table with $1152 \cdot 100$ rows and $4$ columns? As I have just read about Ward's method, it works for tabular datasets as it minimizes the cluster variance; but how do you compute the variance of time series? In general, since Ward's method is based on such a minimization principle, time series with 0 values have 0 variance, as the concept of variance is order independent; thus, you forget about the consecutio temporum of the series (that is, you destroy the temporal order of the values). $\endgroup$
    – Eduard
    Aug 23, 2022 at 11:59
  • $\begingroup$ @Oxedu: Thanks for your comment. Actually I have 100 datapoints. Each of those datapoints has 4 columns (features) with 288 values (rows). So all in all each of those 100 datapoints is represented as a $4*288=1152$ dimensional vector. $\endgroup$
    – PeterBe
    Aug 23, 2022 at 12:12

1 Answer 1


If you have got, say, $100 \times 576$ (i.e., $100$ rows/data points and $576$ columns which represent the linearization of $2$ time series) values that are $0$ and you use a variance-based optimization approach, then including such values will affect the resulting variance, since variance is based on the mean of your observations.

However, assuming that you use a non-randomized clustering procedure, the data points will fall inside the same clusters either including or excluding those 0 values; they will simply have different variances, but those variances are penalized by the same quantity in all the data points (i.e., the mean will be nearer to $0$ including those $0$ values).

If you want to use a randomized procedure, I would suggest you use the same random seed for both experiments to check the result by inspecting some data points in both experiments and see in which cluster they fall.

  • $\begingroup$ Thanks for your answer Oxedu. Does this mean that when using k-means and Ward's method for clustering that it actually does not matter if you have identical 0-columns in all datapoints? $\endgroup$
    – PeterBe
    Aug 23, 2022 at 16:58
  • $\begingroup$ I claim that yes. This is certainly the case for the degenerate case where all data points have $0$ values; this will lead to $0$ variance, they never change, so all points will fall in the same cluster as one may expect. $\endgroup$
    – Eduard
    Aug 23, 2022 at 20:11
  • $\begingroup$ Thanks Oxedu for your answer and effort. Will the clusters also have the same shape? $\endgroup$
    – PeterBe
    Aug 24, 2022 at 7:43
  • $\begingroup$ As you know, k-means has an initialization step, which in general is a random step. I already claimed that both experiments will eventually lead to the same clusters if you set the same random seed. However, the shape is in general different, and this is due to simple vectorial spaces theory; in particular, a vector of size $576$ has a different, call it informally, shape than a vector of size $1152$. I hope that this is sufficient for your question. $\endgroup$
    – Eduard
    Aug 24, 2022 at 11:29

Your Answer

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

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