Skip to content

Discussion - Remove useless warning? #1828

@MarieSacksick

Description

@MarieSacksick

Problem Description

When using this simple piece of code, I have a warning:

from sklearn.datasets import make_classification
from skrub import tabular_pipeline

df, y = make_classification(random_state=42)
estimator = tabular_pipeline("classification")
estimator.fit(df, y)

The warning says:

UserWarning: Only pandas and polars DataFrames are supported, but input is a Numpy array. Please convert Numpy arrays to DataFrames before passing them to skrub transformers. Converting to pandas DataFrame with columns ['0', '1', …].
  warnings.warn(

I don't really understand the point of the warning, because it doesn't seem to be a problem at all.

Feature Description

What about removing the warning since having a numpy array as input doesn't seem to be a problem, at least in that use case with only one column, and doesn't call for a user action?
I'm also surprised by the fact that it seems to mention only the input y - why isn't df also a problem?

Alternative Solutions

Be more explicit about the consequences of automatic conversion. Otherwise as a user, I'm very tempted to turn off warning notifications.

Additional Context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions