Skip to content

Conversation

@tokyRT
Copy link

@tokyRT tokyRT commented Nov 27, 2025

While exploring the tslearn codebase I found a duplicated code.
So I would like to propose to extract that logic to another function to avoid duplication.
And would like to know what do you think about this change. Is worth it or not.

Thanks

@charavelg
Copy link
Contributor

Hi ! Thanks for the PR !!

I believe the predict_proba from KNeighborsTimeSeriesClassifier could benefit from the refactoring as well!! The missing X = to_time_series_dataset(X) is just .... missing :)
I think that _predict_preprocess might not be the proper naming for the function as it actually supercalls the predict(s). I would go for something like _generic_predict.

Anyway, thanks for the most welcome refactoring!

@codecov
Copy link

codecov bot commented Nov 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@7c96436). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #617   +/-   ##
=======================================
  Coverage        ?   91.84%           
=======================================
  Files           ?       68           
  Lines           ?     6191           
  Branches        ?        0           
=======================================
  Hits            ?     5686           
  Misses          ?      505           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants