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

passing test parameters to score_type.compute() #81

Open
rgutzen opened this issue Jul 9, 2018 · 1 comment
Open

passing test parameters to score_type.compute() #81

rgutzen opened this issue Jul 9, 2018 · 1 comment

Comments

@rgutzen
Copy link
Contributor

rgutzen commented Jul 9, 2018

Many implementations of scores have their own parameters, for example for setting the significance level, a bin size, or whether or not to exclude NANs, but per default, there is no way to pass such parameters to the score.
This could be integrated by simply passing the test parameters also to compute_score() (pro: score and test can make use of the same parameters; contra: potential for conflicting namespaces), or have an additional test attribute score_params={}.

@rgerkin
Copy link
Contributor

rgerkin commented Aug 8, 2018

@rgutzen
The way we have implemented these sorts of score manipulations is via "converters" which automatically get applied after compute_score is run during the judge phase. See here for the entry point. The converter is a class from here (or your own, extending from that base Converter class), and is set as the converter attribute of the test in order to activate it. Examples include things like setting a threshold on a ZScore to turn it into a True/False BooleanScore (see the unit tests for converters here for examples).

This does not cover examples that occur before earlier in score computation, such as filtering of data. For those you'd still have to override compute_score in your test, or compute in your score class if you have no compute_score in your test. Since there are an infinite number of things a person might want to do in compute_score, I've left that pretty open-ended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants