Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Narwhals for dataframe-agnostic codebase #671

Merged
merged 16 commits into from
May 24, 2024
Merged

Conversation

FBruzzesi
Copy link
Collaborator

@FBruzzesi FBruzzesi commented May 18, 2024

Description

Partially solves #658 with a large effort in many contributions.

FBruzzesi and others added 11 commits May 7, 2024 20:07
* feat: make ColumnDropped dataframe-agnostic

* use narwhals[polars] in pyproject.toml, link to list of supported libraries

* note that narwhals is used for cross-dataframe support

* test refactor

* docstrings

---------

Co-authored-by: FBruzzesi <[email protected]>
* columnselector with test rufformatted

* adding whitespace

* fixed the fit and transform

* removed intendation in examples

* font:false
* make add_lags dataframe-agnostic

* try getting tests to run?

* patch: cvxpy 1.5.0 support (#663)

---------

Co-authored-by: Francesco Bruzzesi <[email protected]>
* make regression outlier df-agnostic

* need to use eager-only for this one

* pass native to check_array

* remove cudf, link to check_X_y
* make timegapsplit dataframe-agnostic

* actually, include cuDF
* start all over

* fixture working

* wip

* passing tests - again

* pre-commit complaining

* changed fixture on test_demographic_parity
* make pandas dtype selector df-agnostic

* bump version

* 3.8 compat

* Update sklego/preprocessing/pandastransformers.py

Co-authored-by: Francesco Bruzzesi <[email protected]>

* fixup pyproject.toml

* unify (and test!) error message

* deprecate

* update readme

* undo contribution.md change

---------

Co-authored-by: Francesco Bruzzesi <[email protected]>
@FBruzzesi FBruzzesi requested a review from koaning May 18, 2024 10:10
@@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main
- narwhals-development
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this go away once we have it in main?

Copy link
Owner

@koaning koaning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't go through everything in depth, but also didn't see anything wrong when glancing over it. I'll gladly see this stuff life asap also :)

FBruzzesi and others added 5 commits May 20, 2024 17:55
* feat: make grouped and hierarchical dataframe-agnostic

* add pyarrow

* narwhals grouped_transformer

* grouped transformer eureka

* hierarchical narwhalified

* so close but so far

* return series instead of DataFrame for y

* grouped WIP

* merge branch and fix grouped

* future annotations

* format

* handling negative indices

* solve conflicts
Comment on lines +108 to +110
for C in [1, 0.5, 0.1, 0.05]:
fair = DemographicParityClassifier(covariance_threshold=None, sensitive_cols=["x1"], C=C).fit(X, y)
theta_norm = np.abs(np.sum(fair.estimators_[0].coef_))
theta_norm = np.sum(np.abs(fair.estimators_[0].coef_))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc: @koaning here is the change for more stability.
In the meanwhile I am properly investigating to report it to the cvxpy folks

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.

5 participants