-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Extend Scorer #1475
Extend Scorer #1475
Conversation
Codecov Report
@@ Coverage Diff @@
## development #1475 +/- ##
===============================================
- Coverage 84.33% 84.27% -0.06%
===============================================
Files 151 151
Lines 11437 11488 +51
Branches 1984 1994 +10
===============================================
+ Hits 9645 9682 +37
- Misses 1265 1275 +10
- Partials 527 531 +4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good in general, but it would be great if this would be accompanied by some unit tests, for example for the train evaluator and the metrics module.
|
||
|
||
def make_scorer( | ||
name: str, | ||
score_func: Callable, | ||
*, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
def metric_which_needs_x(solution, prediction, x_data, extra_argument): | ||
# custom function defining accuracy | ||
assert x_data is not None | ||
return np.mean(solution[extra_argument, :] == prediction[extra_argument, :]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we illustrate with some arbitrary use of x_data
for the example, i.e. make rows with NaNs count for twice as much?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the example with a more meaningful metric
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks all good, a new unit test in the file test_train_evaluator.py
, which ensures that the data is correctly emitted to disk, would be great to have, though.
I will run the benchmark on this, it's hard to implement this feature into the |
Co-authored-by: Matthias Feurer <feurerm@informatik.uni-freiburg.de>
* FIX minor * update submodule * update submodule * ADD pass xdata to metric * update submodule * Fix tests * update submodule * ADD example * UPDATE example * ADD extra method to concat data * RM note * Fix minor * ADD more types for xdata * FIX unittests * FIX variable naming bug * change varible name; fix docstring * Rename variable * FIX example * Update examples/40_advanced/example_metrics.py Co-authored-by: Matthias Feurer <feurerm@informatik.uni-freiburg.de> Co-authored-by: Matthias Feurer <feurerm@informatik.uni-freiburg.de>
This PR enables ASKL to work with a wider range of metrics and scorers. Concretely, it does the following: