Time series scalers reject ragged lists despite variable-length support

Abierto
#751 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@sunlishuo25 ya está trabajando en esto.

Desde el 5/10/2026.

  • #752 de @sunlishuo25 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
numpy, python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Python
Estrellas
3.2k
Forks
418
Merge medio
2 d 14 h
PR fusionados (30 d)
24

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de tslearn-team/tslearn

Todos los issues de tslearn-team/tslearn

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.