Time series scalers reject ragged lists despite variable-length support

未关闭
#751 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@sunlishuo25 已经在做这个了。

开始于 2026年10月5日。

  • #752 来自 @sunlishuo25 —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
numpy, python

调研方向

Start by running the reproducer in the issue, then read the implementations of TimeSeriesScalerMinMax and TimeSeriesScalerMeanVariance and their existing tests. Check fit_transform, transform, and inverse_transform against the expected behavior for ragged input, including the stated validation checks. Done means ragged lists match the results from explicitly calling to_time_series_dataset; an open pull request is already linked.

由索引模型根据 Issue 内容生成。

描述

Describe the bug
TimeSeriesScalerMinMax and TimeSeriesScalerMeanVariance reject a list containing time series of different lengths. The same data succeeds after explicitly calling to_time_series_dataset, and other variable-length preprocessors accept such lists directly.

To Reproduce

from tslearn.preprocessing import TimeSeriesScalerMinMax

TimeSeriesScalerMinMax().fit_transform([[1, 3], [5, 7, 9]])

This raises ValueError: setting an array element with a sequence ... inhomogeneous shape. The same problem affects TimeSeriesScalerMeanVariance, transform after fitting padded input, and inverse_transform with per_timeseries=False.

Expected behavior
Validate the individual time series, pad shorter series with NaN, and produce the same result as explicitly formatting the dataset first. Preserve fitted-state, feature-count and invalid-input checks.

Environment
macOS arm64, Python 3.11.9, tslearn 0.10.0.dev at 9ef74f9602a93057cb1e3e5fdb389e210a4f4f97, NumPy 2.4.6, scikit-learn 1.7.2.

Developed with GPT assistance

主要语言
Python
星标
3.2k
派生
418
平均合并
2 天 14 小时
30 天内合并 PR
24

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

tslearn-team/tslearn 的其他 Issue

查看 tslearn-team/tslearn 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。