kiudee / cs-ranking

Context-sensitive ranking and choice in Python with PyTorch
https://cs-ranking.readthedocs.io
Apache License 2.0
66 stars 15 forks source link

Do not store kwargs #155

Closed timokau closed 4 years ago

timokau commented 4 years ago

Description

Changes are on top of #154 to avoid merge conflicts.

~#154 should be reviewed first.~

Motivation and Context

The mechanism is replaced by the already established prefixing and an explicit prefix whitelist. This is more explicit than just passing around "raw" kwargs, easier to understand and satisfies the "no attributes in init" check for scikit-learn estimators.

How Has This Been Tested?

Pre-commit and test suite.

Does this close/impact existing issues?

Related to #94, #116, #146.

Types of changes

Checklist:

codecov[bot] commented 4 years ago

Codecov Report

Merging #155 into master will decrease coverage by 8.41%. The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #155      +/-   ##
==========================================
- Coverage   57.04%   48.62%   -8.42%     
==========================================
  Files         113      113              
  Lines        6560     6566       +6     
==========================================
- Hits         3742     3193     -549     
- Misses       2818     3373     +555     
Impacted Files Coverage Δ
csrank/constants.py 100.00% <ø> (ø)
csrank/discretechoice/cmpnet_discrete_choice.py 58.82% <ø> (-41.18%) :arrow_down:
csrank/objectranking/cmp_net.py 100.00% <ø> (ø)
csrank/discretechoice/fate_discrete_choice.py 45.45% <25.00%> (-54.55%) :arrow_down:
csrank/discretechoice/feta_discrete_choice.py 19.53% <25.00%> (-31.67%) :arrow_down:
csrank/learner.py 69.11% <85.71%> (+5.32%) :arrow_up:
csrank/choicefunction/cmpnet_choice.py 92.85% <100.00%> (+0.26%) :arrow_up:
csrank/choicefunction/fate_choice.py 93.93% <100.00%> (+0.39%) :arrow_up:
csrank/choicefunction/feta_choice.py 65.00% <100.00%> (+0.76%) :arrow_up:
csrank/core/cmpnet_core.py 97.61% <100.00%> (-0.09%) :arrow_down:
... and 25 more
timokau commented 4 years ago

Rebased and ready for review.