Time series scalers reject ragged lists despite variable-length support

Đang mở
#751 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@sunlishuo25 đang làm issue này rồi.

Từ ngày 5/10/2026.

  • #752 của @sunlishuo25 — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
numpy, python
Lĩnh vực
machine-learning

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Python
Star
3.2k
Fork
418
Merge trung bình
2 ngày 14 giờ
Pull request đã merge (30 ngày)
24

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của tslearn-team/tslearn

Tất cả issue của tslearn-team/tslearn

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.