Skip to content

sklego/interval-encoder-ignored-span

Pack Severity Fix Versions
scikit-lego error none, edit by hand All versions

sklego.preprocessing.IntervalEncoder uses span only for method="normal" and silently ignores it for method="increasing" or method="decreasing". At fit time, any span <= 0 or span > 1 raises ValueError.

enc = IntervalEncoder(n_chunks=8, span=0.5, method="increasing")
enc = IntervalEncoder(n_chunks=8, method="increasing")

Calls to IntervalEncoder that pass span alongside method="increasing" or method="decreasing", or pass a numeric literal span outside (0, 1].

Omit span for monotonic method="increasing" or method="decreasing", or supply 0 < span <= 1 with method="normal".

IntervalEncoder ignores span when method is "increasing" or "decreasing". Drop span or use method="normal".

See all rules in the scikit-lego pack.