Skip to content

_has_outliers is duplicated in engine/missing.py and engine/model_select.py #33

Description

@JohnnyWilson16

An identical _has_outliers function exists in:

  • engine/missing.py
  • engine/model_select.py

Both call detection_bounds(s, "iqr", 1.5) with a hardcoded factor. If one is updated and the other isn't, the imputation ranking (rank_missing_models) and the actual imputation logic (_handle_low) will disagree on whether a column has outliers — leading to the report saying "mean is appropriate for this normal distribution" while the actual fill uses "median".
Fix: Consolidate into a single function in a shared location (e.g. steps/outliers.py) and import it in both modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions