Skip to content

Commit 337bc52

Browse files
committed
more doc refinements
1 parent b6f606e commit 337bc52

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

src/fit_update.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@ overloaded to return `true`.
3939
4040
The signature must include `verbosity` with `1` as default.
4141
42-
If `data` encapsulates a *target* variable, as defined in LearnAPI.jl documentati[on, then
43-
[`LearnAPI.target(data)`](@ref) must be overloaded to return it. If [`predict`](@ref) or
44-
[`transform`](@ref) are implemented and consume data, then
45-
[`LearnAPI.features(data)`](@ref) must return something that can be passed as data to
46-
these methods. A fallback returns `first(data)` if `data` is a tuple, and `data`
47-
otherwise.
42+
If `data` encapsulates a *target* variable, as defined in LearnAPI.jl documentation, then
43+
[`LearnAPI.target`](@ref) must be implemented. If [`predict`](@ref) or [`transform`](@ref)
44+
are implemented and consume data, then you made need to overload
45+
[`LearnAPI.features`](@ref).
4846
4947
The LearnAPI.jl specification has nothing to say regarding `fit` signatures with more than
5048
two arguments. For convenience, for example, an implementation is free to implement a

src/predict_transform.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ implementation must be added to the list returned by
9898
[`LearnAPI.kinds_of_proxy(learner)`](@ref). List all available kinds of proxy by doing
9999
`LearnAPI.kinds_of_proxy()`.
100100
101-
If `data` is not present in the implemented signature (eg., for density estimators) then
102-
[`LearnAPI.features(learner, data)`](@ref) must return `nothing`.
101+
When `predict` is implemented, it may be necessary to overload
102+
[`LearnAPI.features`](@ref). If `data` is not present in the implemented signature (eg.,
103+
for density estimators) then [`LearnAPI.features(learner, data)`](@ref) must always return
104+
`nothing`.
103105
104106
$(DOC_IMPLEMENTED_METHODS(":(LearnAPI.predict)"))
105107
@@ -161,7 +163,12 @@ See also [`fit`](@ref), [`predict`](@ref),
161163
# New implementations
162164
163165
Implementation for new LearnAPI.jl learners is
164-
optional. $(DOC_IMPLEMENTED_METHODS(":(LearnAPI.transform)"))
166+
optional.
167+
168+
When `predict` is implemented, it may be necessary to overload
169+
[`LearnAPI.features`](@ref).
170+
171+
$(DOC_IMPLEMENTED_METHODS(":(LearnAPI.transform)"))
165172
166173
$(DOC_SLURPING(:transform))
167174

src/target_weights_features.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ the LearnAPI.jl documentation.
2424
2525
A fallback returns `nothing`. The method must be overloaded if [`fit`](@ref) consumes data
2626
that includes a target variable. If `obs` is not being overloaded, then `observations`
27-
above is any `data` supported in calls of the form [`fit(learner, data)`](@ref). The form
27+
above is any `data` supported in calls of the form [`fit(learner, data)`](@ref). The form
2828
of the output `y` should be suitable for pairing with the output of [`predict`](@ref), in
2929
the evaluation of a loss function, for example.
3030
@@ -93,11 +93,11 @@ The object `X` returned by `LearnAPI.features` has the same number of observatio
9393
9494
A fallback returns `first(observations)` if `observations` is a tuple, and otherwise
9595
returns `observations`. New implementations may need to overload this method if this
96-
fallback is inadequate.
96+
fallback is inadequate.
9797
9898
For density estimators, whose `fit` typically consumes *only* a target variable, you
99-
should overload this method to return `nothing`. If `obs` is not being overloaded, then
100-
`observations` above is any `data` supported in calls of the form [`fit(learner,
99+
should overload this method to always return `nothing`. If `obs` is not being overloaded,
100+
then `observations` above is any `data` supported in calls of the form [`fit(learner,
101101
data)`](@ref).
102102
103103
It must otherwise be possible to pass the return value `X` to `predict` and/or

0 commit comments

Comments
 (0)