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

[REVIEW] Add get_params() to TargetEncoder #4588

Merged
merged 20 commits into from
Feb 22, 2022

Conversation

daxiongshu
Copy link
Contributor

This PR adds get_params() member function to TargetEncoder. Hopefully it can resolve the issue #4574

@daxiongshu daxiongshu requested a review from a team as a code owner February 18, 2022 03:51
@github-actions github-actions bot added the Cython / Python Cython or Python issue label Feb 18, 2022
@daxiongshu daxiongshu added non-breaking Non-breaking change feature request New feature or request labels Feb 18, 2022
@daxiongshu
Copy link
Contributor Author

I ended up not subclassing cuml.Base.

@daxiongshu daxiongshu changed the title [WIP] Add get_params() to TargetEncoder [REVIEW] Add get_params() to TargetEncoder Feb 19, 2022
@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (branch-22.04@647f7cd). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##             branch-22.04    #4588   +/-   ##
===============================================
  Coverage                ?   83.88%           
===============================================
  Files                   ?      250           
  Lines                   ?    20061           
  Branches                ?        0           
===============================================
  Hits                    ?    16828           
  Misses                  ?     3233           
  Partials                ?        0           
Flag Coverage Δ
dask 45.17% <0.00%> (?)
non-dask 76.98% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 647f7cd...cdc216b. Read the comment docs.

Copy link
Contributor

@viclafargue viclafargue left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! It looks good to me. Would be interesting, in a follow-up PR, to make this class an estimator by inheriting from the Base class (see estimator guide).

Comment on lines +416 to +425
def get_params(self):
"""
Returns a dict of all params owned by this class.
"""
params = dict()
variables = self.get_param_names()
for key in variables:
var_value = getattr(self, key, None)
params[key] = var_value
return params
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be inheritable from the cuml.common.base.Base class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the review. Yes, I tried inheriting base in the first place but I ended up making more changes than necessary to pass test_base.py. I'll try again in another PR.

Copy link
Member

@dantegd dantegd left a comment

Choose a reason for hiding this comment

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

codeowner approval following @viclafargue approval

@dantegd
Copy link
Member

dantegd commented Feb 22, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 6cf64f6 into rapidsai:branch-22.04 Feb 22, 2022
rapids-bot bot pushed a commit that referenced this pull request Feb 24, 2022
This is the continuation of PR #4588 to resolve issue #4574

Authors:
  - Jiwei Liu (https://github.com/daxiongshu)

Approvers:
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: #4601
vimarsh6739 pushed a commit to vimarsh6739/cuml that referenced this pull request Oct 9, 2023
This PR adds `get_params()` member function to `TargetEncoder`. Hopefully it can resolve the issue rapidsai#4574

Authors:
  - Jiwei Liu (https://github.com/daxiongshu)

Approvers:
  - Victor Lafargue (https://github.com/viclafargue)
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: rapidsai#4588
vimarsh6739 pushed a commit to vimarsh6739/cuml that referenced this pull request Oct 9, 2023
…#4601)

This is the continuation of PR rapidsai#4588 to resolve issue rapidsai#4574

Authors:
  - Jiwei Liu (https://github.com/daxiongshu)

Approvers:
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: rapidsai#4601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cython / Python Cython or Python issue feature request New feature or request non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants