Skip to content

Commit 5e08aab

Browse files
committed
doc tweak
1 parent 242cb34 commit 5e08aab

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

docs/src/predict_transform.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,29 @@ dimension using distances from the cluster centres.
8484

8585
### [One-liners combining fit and transform/predict](@id one_liners)
8686

87-
Learners may optionally overload `transform` to apply `fit` first, using the supplied
88-
data if required, and then immediately `transform` the same data. The same applies to
89-
`predict`. In that case the first argument of `transform`/`predict` is an *learner*
90-
instead of the output of `fit`:
87+
Learners may additionally overload `transform` to apply `fit` first, using the supplied
88+
data if required, and then immediately `transform` the same data. In that case the first
89+
argument of `transform` is an *learner* instead of the output of `fit`:
9190

9291
```julia
93-
predict(learner, kind_of_proxy, data) # `fit` implied
9492
transform(learner, data) # `fit` implied
9593
```
9694

97-
For example, if `fit(learner, X)` is defined, then `predict(learner, X)` will be
98-
shorthand for
95+
This will be shorthand for
9996

10097
```julia
101-
model = fit(learner, X)
102-
predict(model, X)
98+
model = fit(learner, X) # or `fit(learner)` in the static case
99+
transform(model, X)
100+
```
101+
102+
The same remarks apply to `predict`, as in
103+
104+
```julia
105+
predict(learner, kind_of_proxy, data) # `fit` implied
103106
```
104107

108+
LearnAPI.jl does not, however, guarantee the provision of these one-liners.
109+
105110
## [Reference](@id predict_ref)
106111

107112
```@docs

docs/src/reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ values; for such learners [`LearnAPI.is_composite`](@ref)`(learner)` must be `tr
108108
(fallback is `false`). Generally, the keyword constructor provided by
109109
[`LearnAPI.constructor`](@ref) must provide default values for all properties that are not
110110
learner-valued. Instead, these learner-valued properties can have a `nothing` default,
111-
with the constructor throwing an error if the the constructor call does not explicitly
111+
with the constructor throwing an error if the constructor call does not explicitly
112112
specify a new value.
113113

114114
Any object `learner` for which [`LearnAPI.functions(learner)`](@ref) is non-empty is
@@ -150,7 +150,7 @@ minimal (but useless) implementation, see the implementation of `SmallLearner`
150150

151151
### List of methods
152152

153-
- [`fit`](@ref fit_docs): for (i) training or updating learners that generalize to new
153+
- [`fit`](@ref fit_docs): for (i) training learners that generalize to new
154154
data; or (ii) wrapping `learner` in an object that is possibly mutated by
155155
`predict`/`transform`, to record byproducts of those operations, in the special case of
156156
*non-generalizing* learners (called here [static algorithms](@ref static_algorithms))

0 commit comments

Comments
 (0)