tslearn-team / tslearn-team/tslearn

Question about using DBA to create a average curve from several input curves

Open
#522 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

metrics question
Dominant language
Python
Stars
3.2k
Forks
384
Avg merge
3d 12h
Merged PRs (30d)
11

Description

Hi,

I have a question about using DBA to get the average time series of a data set consisting of several measurements. I have collected the knee joint angles during gait for several subjects. Now I want to create the average knee flexion from this data. During my search on how to do this I found out about using DTW for averaging and thought this might a good way since in takes into consideration the slightly different curve shapes in constrast to a simple mean over all curves.

However the results I get from using DBA look very strange to me. For example using softdtw_barycenter with gamma=1, max_iter=50 and tol=1e-3 I get the following result, where the black line is the result and the colored lines are the individual input curves:
Figure_4

Here I dont understand where the spikes come from. This also happens when I try different parameters or other algorithms like dtw_barycenter_averaging.

On contrast when I use the euclidean_barycenter the output looks more like I would expect:

Figure_1

So now my question is: Is the result due to my data or did I select the wrong parameters? Or is the result supposed to look this way and DBA is simply not the right way to get a physiologically reasonable average knee flexion?

Many thanks in advance!

Best regards,
michael

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report concerns softdtw_barycenter and dtw_barycenter_averaging, but it provides no runnable inputs, code, or named repository files. First request a minimal reproducible example with the input curves and parameters, then compare both barycenter methods with euclidean_barycenter. Done means determining whether the spikes are expected for these inputs or reveal a reproducible implementation or documentation problem.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.