# Passing \`transportcost\` to \`dtw\` in \`DeepPumas.cluster\_subjects\`?

**URL:** <https://discourse.pumas.ai/t/passing-transportcost-to-dtw-in-deeppumas-cluster-subjects/1400>\
**Category:** How-to\
**Created:** [May 11, 2026, 4:51am UTC](https://discourse.pumas.ai/t/passing-transportcost-to-dtw-in-deeppumas-cluster-subjects/1400 "2026-05-11T04:51:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dom-linkevicius](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/dom-linkevicius/32/446_2.png) [@dom-linkevicius](https://discourse.pumas.ai/u/dom-linkevicius)\
**Post date:** [May 11, 2026, 4:51am UTC](https://discourse.pumas.ai/t/passing-transportcost-to-dtw-in-deeppumas-cluster-subjects/1400/1 "2026-05-11T04:51:38Z")

</div>

The `dtw` function in `DynamicAxisWarping.jl` has a `transportcost` kwarg. Is it possible to pass this kwarg to `cluster_subjects`? As per [this post](https://discourse.pumas.ai/t/what-distance-function-is-used-in-deeppumas-cluster-subjects-dtw/1369/3), it is possible to pass a different distance function via a kwarg that’s not documented in the DeepPumas docs, so hoping that `transportcost` is also available. In my case `dtw` “overfits” with the default `transportcost` value - clusters subjects that visually should be in a different cluster, but due to long distance degenerate alignment, they get incorrectly clustered.

@LucasMatSP

---

<div class="post-metadata">

**Author:** ![LucasMatSP](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/lucasmatsp/32/452_2.png) [@LucasMatSP](https://discourse.pumas.ai/u/LucasMatSP)\
**Post date:** [May 13, 2026, 2:18pm UTC](https://discourse.pumas.ai/t/passing-transportcost-to-dtw-in-deeppumas-cluster-subjects/1400/2 "2026-05-13T14:18:51Z")

</div>

Hi, Domas.

Sorry for the delay. Unfortunately, `transportcost` isn’t available. We can look into including it. If you have more feedback, please share it, so we consider everything in one go.
