Skip to content

Migrate TargetMeanRegressor to narwhals, add polars support - #1069

Merged
solegalli merged 1 commit into
narwhals-migrationfrom
narwhals-target-mean-regressor
Nov 21, 2026
Merged

solegalli merged 1 commit into
narwhals-migrationfrom
narwhals-target-mean-regressor

Conversation

@solegalli

@solegalli solegalli commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

TargetMeanRegressor no longer imports pandas and takes any dataframe supported by narwhals, with the target as a series, numpy array or list. All the computation lives in the base class; the regressor only checks that the target is not binary.

Output is unchanged on pandas, and polars gives the same values.

Drop the pandas import and type fit and predict for any narwhals-supported
dataframe, with the target as a series, numpy array or list. Rewrite the
tests to run on pandas and polars, and add a polars example to the docstring.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@solegalli
solegalli force-pushed the narwhals-target-mean-regressor branch from 452985c to a9f2cf2 Compare November 21, 2026 09:30
@solegalli
solegalli merged commit 916e13e into narwhals-migration Nov 21, 2026
4 of 10 checks passed
@solegalli
solegalli deleted the narwhals-target-mean-regressor branch November 21, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant