@@ -8,7 +8,7 @@ const QUIET = "- specify `verbosity=1` if debugging"
88
99const CONSTRUCTOR = """
1010
11- Testing that learner can be reconstructed from its constructors .
11+ Testing that learner can be reconstructed from its constructor .
1212 [Reference](https://juliaai.github.io/LearnAPI.jl/dev/reference/#learners).
1313
1414 """
@@ -34,23 +34,53 @@ const FUNCTIONS = """
3434 """
3535const ERR_MISSINNG_OBLIGATORIES =
3636 " These obligatory functions are missing from the return value of " *
37- " `LearnAPI.functions(learner)`; "
37+ " `LearnAPI.functions(learner)`: "
38+
39+
40+
41+ const DECONSTRUCTORS = """
42+
43+ Checking that the data deconsructors (`features`, `target` and `weights`) have only
44+ been implemented where appropriate, and looking for clues that some desirable
45+ implementations have been forgotten.
46+
47+ """
48+ const WARN_GENERATIVE_NO_TARGET = """
49+
50+ Typically, when `LearnAPI.kind_of(learner)==LearnAPI.Generative()`, we expect
51+ `LearnAPI.target` to be implemented. If you have implemented it, check you added
52+ `:(LearnAPI.target)` to the tuple returned by `LearnAPI.functions(learner)`. If you
53+ intentionally left it unimplemented, ignore this warning.
54+
55+ """
56+ const NO_DECONSTRUCTORS_FOR_STATIC = """
57+
58+ Since `LearnAPI.kind_of(learner)==LearnAPI.Static()`, we are checking that none of the
59+ following are in the tuple returned by `LearnAPI.functions(learner)`:
60+ `:(LearnAPI.features)`, `:(LearnAPI.target)`, `:(LearnAPI.weights)`, because there
61+ is never training data to deconstruct.
3862
39- const FUNCTIONS3 = """
63+ """
64+ const WARN_DESCRIMINATIVE_NO_FEATURES = """
4065
41- Testing that `LearnAPI.functions(learner)` includes `:(LearnAPI.features).`
66+ Typically, when `LearnAPI.kind_of(learner)==LearnAPI.Descriminative()`, we expect
67+ `LearnAPI.features` to be implemented. If you have implemented it, check you added
68+ `:(LearnAPI.features)` to the tuple returned by `LearnAPI.functions(learner)`. If you
69+ intentionally left it unimplemented, ignore this warning.
4270
4371 """
44- const FUNCTIONS4 = """
72+ const WARN_DESCRIMINATIVE_NO_TARGET = """
4573
46- Testing that `LearnAPI.functions(learner)` excludes `:(LearnAPI.features)`, as
47- `LearnAPI.is_static(learner)` is `true`.
74+ Frequently, when `LearnAPI.kind_of(learner)==LearnAPI.Descriminative()`,
75+ `LearnAPI.target` is also implemented. If you have implemented it, check you added
76+ `:(LearnAPI.features)` to the tuple returned by `LearnAPI.functions(learner)`. If you
77+ intentionally left it unimplemented, ignore this warning.
4878
4979 """
5080const TAGS = """
5181
5282 Testing that `LearnAPI.tags(learner)` has correct form. List allowed tags with
53- `LearnAPII .tags()`.
83+ `LearnAPI .tags()`.
5484
5585 """
5686const KINDS_OF_PROXY = """
@@ -62,14 +92,14 @@ const KINDS_OF_PROXY = """
6292 """
6393const FIT_IS_STATIC = """
6494
65- `LearnAPI.is_static (learner)` is `true` . Therefore attempting to call
66- `fit(learner)`.
95+ `LearnAPI.kind_of (learner)==LearnAPI.Static()` . Therefore attempting to define
96+ `model = fit(learner)`.
6797
6898 """
6999const FIT_IS_NOT_STATIC = """
70100
71- Attempting to call ` fit(learner, data)`. If you implemented `fit(learner)` instead,
72- then you need to arrange `LearnAPI.is_static (learner) == true `.
101+ Attempting to define `model = fit(learner, data)`. If you implemented `fit(learner)`
102+ instead, then you need to arrange `LearnAPI.kind_of (learner)==LearnAPI.Static() `.
73103
74104 """
75105const LEARNER = """
@@ -86,7 +116,7 @@ const FUNCTIONS2 = """
86116
87117 """
88118const ERR_MISSING_FUNCTIONS =
89- " The following overloaded functions are missing from the return value of" *
119+ " The following implemented/ overloaded functions are missing from the return value of" *
90120 " `LearnAPI.functions(learner)`: "
91121
92122const OBS = """
@@ -118,7 +148,9 @@ const PREDICT_HAS_NO_FEATURES = """
118148
119149 Attempting to call `predict(model, kind)` for each `kind` in
120150 `LearnAPI.kinds_of_proxy(learner)`. (We are not providing `predict` with a data
121- argument because `features(obs(learner, data)) == nothing`).
151+ argument because either `LearnAPI.kind_of(learner)==LearnAPI.Generative()`, or because
152+ we presume `LearnAPI.features` is not implemented, as `:(LearnAPI.features)` is not in
153+ the return value of LearnAPI.functions(learner)`.)
122154
123155
124156 """
@@ -256,14 +288,12 @@ const TRANSFORM_ON_SELECTIONS2 = """
256288 """
257289const TARGET0 = """
258290
259- Attempting to call `LearnAPI.target(learner, data)` (fallback returns
260- `last(data)`).
291+ Attempting to call `LearnAPI.target(learner, data)`.
261292
262293 """
263294const TARGET = """
264295
265- Attempting to call `LearnAPI.target(learner, observations)` (fallback returns
266- `last(observations)`).
296+ Attempting to call `LearnAPI.target(learner, observations)`
267297
268298 """
269299const TARGET_SELECTIONS = """
@@ -311,7 +341,7 @@ const UPDATE = """
311341 """
312342const ERR_STATIC_UPDATE = ErrorException (
313343 " `(LearnAPI.update)` is in `LearnAPI.functions(learner)` but " *
314- " `LearnAPI.is_static (learner)` is `true `. You cannot implement `update` " *
344+ " `LearnAPI.kind_of (learner)==LearnAPI.Static() `. You cannot implement `update` " *
315345 " for static learners. "
316346)
317347const UPDATE_ITERATIONS = """
0 commit comments