-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Custom functions: e.g. custom metrics #141
base: master
Are you sure you want to change the base?
Conversation
TODO: add description to HOWTO documentation. |
…ntegration for custom metrics
55b7c04
to
8849ce3
Compare
In general, we can expect AutoML frameworks to expect different signatures for their metric function. We define a new signature specific to the amlb, so that we can also report the scores. This will be denoted with a trailing underscore ("metric_"). It allows the user to define two methods, e.g. Accuracy and Accuracy_, the former will be used by the automl framework, the latter by us.
There is no automl framework that is going to have the format that the amlb uses, so sharing the definition makes no sense until we alter the signature in the amlb.
It looks like the metric is not reported in the results, so I set up #173. * I did run into a small issue where the amlb framework provides the |
Allow custom metrics to be reported in results
comment by seb from #173:
Is this a thing we expect to worry about in practice? I suppose automl packages could have their own metrics predefined to import, but if that is the case a scikit-learn fallback would not be enough either. |
I was trying to make the distinction between the custom metric used by the framework for optimization (this one may be provided by the automl package), and the one that we compute ex post from the |
Exactly. And this is what the current implementation already facilitates as far as I am aware? |
adding generic support for frameworks extensions with an example of integration for custom metrics.
Extensions are loaded by default from
{user}/extensions.py
.User can define as many extension files as he wants in his
config.yaml
, e.g.a specific variable, function or class defined in those files can be loaded by name from the framework integration using:
The first name that could be loaded succesfully will be returned.
For example, if 'foo' is defined on all the extensions files above, and we're running
TPOT
, then the first 2 files may fail loading in TPOT integration if they importautogluon
orautosklearn
modules, however loading{user}/tpot_extensions.py
should succeed, so if there's a variable/function named "foo" there, it will be returned, otherwise it will look into the last file.This PR shows how this can be used to inject custom metrics in frameworks like
autogluon
,autosklearn
andTPOT
: #127for example if user overrides default metrics in his
config.yaml
:then it is then possible to define the 'foo' custom metric in the extensions files, and it will then be used by frameworks that accept it.