Skip to content

fetch_supported_metrics() fails at import due to inadequate dummy data #58

@tanmaygarg2911

Description

@tanmaygarg2911

Problem: The function tries to detect supported sklearn metrics by calling them with dummy data, but:

  • Only catches TypeError (missing: ValueError, AttributeError, AxisError)
  • Uses Python lists instead of numpy arrays
  • Uses 1D arrays, but classification metrics need 2D probability arrays
  • Uses integer dtype, but some metrics require float

Impact: Library cannot be imported at all.

Root cause: Metrics have diverse input requirements that a single dummy dataset cannot satisfy.

Proposed solutions:

  1. Use multiple dummy datasets (1D regression, 2D classification probabilities)
  2. Catch broader exception types

I can submit a PR with the approach you prefer.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions