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
Open
ablaom
wants to merge
27
commits into
master
Choose a base branch
from
kind-of-learner
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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.59% -0.12%
==========================================
Files 9 8 -1
Lines 87 83 -4
==========================================
- Hits 85 81 -4
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 betrue
orfalse
, with a newtrait
kind_of(leaner)
taking one of three possible values:Discriminative()
,Generative()
andStatic()
. More on these core patterns below.Dump the
Single <: KindOfProxy
abstract type, and all it's sole instances, along thelines described in Dump the
Single <: KindOfProxy
subtypes #53.Adjust the role of the training data deconstructor,
features(learner, data)
: Whereaspreviously, it needed to be overloaded to return
nothing
to flag thatpredict
consumes 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
data
topredict
ortransform
)Remove the fallbacks for all three training data deconstructors,
features
,target
,weights
.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
features
method. 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:
LearnTestAPI
to 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.Descriminative
pattern, looks like this:Here
learner
specifies hyperparameters, whilemodel
storeslearned parameters and any byproducts of algorithm execution.
Transformers ordinarily implement
transform
instead ofpredict
. For more onpredict
versustransform
, see Predict or transform?Two other
fit
/predict
/transform
patterns supported by LearnAPI.jl are:LearnAPI.Generative
which 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.