generated from JuliaAI/MLJExampleInterface.jl
-
Notifications
You must be signed in to change notification settings - Fork 2
LearnAPI 2.0 #54
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
Merged
Merged
LearnAPI 2.0 #54
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fix a bad link
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #54 +/- ##
==========================================
+ Coverage 97.70% 97.77% +0.07%
==========================================
Files 9 9
Lines 87 90 +3
==========================================
+ Hits 85 88 +3
Misses 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this breaking PR we:
Replace the trait
is_static(learner)- which could betrueorfalse, with a newtrait
kind_of(leaner)taking one of three possible values:Discriminative(),Generative()andStatic(). More on these core patterns below.Dump the
Single <: KindOfProxyabstract type, and all it's sole instances, along thelines described in Dump the
Single <: KindOfProxysubtypes #53.Adjust the role of the training data deconstructor,
features(learner, data): Whereaspreviously, it needed to be overloaded to return
nothingto flag thatpredictconsumes no data (which is now is indicated by declaring
kind_of(learner) = Generative()) it is now implemented only ifkind_of(learner) == Discriminative(), andonly if it fulfills the old contract (it's output is can be passed as valid
datatopredictortransform)Remove the fallbacks for all three training data deconstructors,
features,target,weights.(edit) Add a default verbosity preference using Preferences.jl, a setter/getter
default_verbosity(), and requirefitimplementations to use the default.The main point of change (1) is to make explicit what was already implicit in the design,
but delineated with the awkward use of the
featuresmethod. It also scaffolds the change(2).
The main point of (4) is to simplify, unify, and to remove "hidden knowledge" (the
existence and form of the fallbacks).
Note that I've had to comment out the LearnTestAPI part of the docs, because that package is a downstream dependency. (Changes there have already been worked out and tested.) So after this PR is merged and a new release tagged, we'll need to:
LearnTestAPIto docs/Project.toml)Below is an extract from the new documentation introducing the core patterns discussed in (1). Note that these patterns already existed - they just weren't explicitly named before.
LearnAPI.jl supports three core patterns. The default pattern, known as the
LearnAPI.Descriminativepattern, looks like this:Here
learnerspecifies hyperparameters, whilemodelstoreslearned parameters and any byproducts of algorithm execution.
Transformers ordinarily implement
transforminstead ofpredict. For more onpredictversustransform, see Predict or transform?Two other
fit/predict/transformpatterns supported by LearnAPI.jl are:LearnAPI.Generativewhich has the form:and
LearnAPI.Static, which looks like this:Do not read too much into the names for these patterns, which are formalized here. Use may not always correspond to prior associations.