Skip to content

Commit 12b8f4b

Browse files
committed
add to docs: fit/predict/trans must support subsampled data
1 parent 0d66698 commit 12b8f4b

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

docs/src/common_implementation_patterns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ implementations fall into one (or more) of the following informally understood p
3131

3232
- Missing Value Imputation
3333

34-
- [Transformers](@ref): Other transformers, such as standardizers, and categorical
35-
encoders.
34+
- [Transformers](@ref transformers): Other transformers, such as standardizers, and
35+
categorical encoders.
3636

3737
- [Static Algorithms](@ref): Algorithms that do not learn, in the sense they must be
3838
re-executed for each new data set (do not generalize), but which have hyperparameters

docs/src/patterns/transformers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Transformers
1+
# [Transformers](@id transformers)
22

33
Check out the following examples:
44

src/obs.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ fit(learner, observations)` is equivalent to `model = fit(learner, data)`, whene
5757
`predict(model, ..., observations)` and `transform(model, observations)` must be supported
5858
alternatives with the same output, whenever `observations = obs(model, data)`.
5959
60-
Implicit in the above requirements is that `obs(learner, _)` and `obs(model, _)` are
60+
If `LearnAPI.data_interface(learner) == RandomAccess()` (the default), then `fit`,
61+
`predict` and `transform` must additionally accept `obs` output that has been *subsampled*
62+
using `MLUtils.getobs`, with the obvious interpretation applying to the outcomes of such
63+
calls (e.g., if *all* observations are subsampled, then outcomes should be the same as if
64+
using the original data).
65+
66+
Implicit in preceding requirements is that `obs(learner, _)` and `obs(model, _)` are
6167
involutive, meaning both the following hold:
6268
6369
```julia

0 commit comments

Comments
 (0)