PAA / SAX / 1d-SAX silently return NaN or garbage when n_segments is larger than the series length

Aperta
#852 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@MohamedO6 ci sta già lavorando.

Dal 4/12/2026.

  • #853 di @MohamedO6 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
20/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python, scikit-learn

Direzione di ricerca

The issue names PiecewiseAggregateApproximation, SymbolicAggregateApproximation, and OneD_SymbolicAggregateApproximation, but gives no file or test paths. Start by locating those classes and their existing tests, then check how they handle n_segments values of 0, 2.5, and values larger than the series length. Done means each class raises a clear ValueError for invalid values; an open linked pull request already covers this work.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

With X = [[1, 2, 3]] and n_segments=5 on current main, PiecewiseAggregateApproximation returns [nan, 1, nan, 2, 3] because some segments are empty. SymbolicAggregateApproximation turns the NaN segments into arbitrary symbols without any error ([2 2 2 2 2]), and OneD_SymbolicAggregateApproximation fails with Found array with 0 sample(s) ... required by LinearRegression. n_segments=0 or 2.5 is not checked either.

Proposal: raise a clear ValueError when n_segments is not a positive integer or exceeds the series length.

I have a fix with tests ready and can open a PR if that's welcome.

Lingua principale
Python
Stelle
3.2k
Fork
418
Merge medio
2g 14h
PR unite (30g)
24

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tslearn-team/tslearn

Tutte le issue di tslearn-team/tslearn

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.