1
1
"""
2
- fit(model, verbosity, data...) -> fitresult, cache, report
2
+ MLJModelInterface. fit(model, verbosity, data...) -> fitresult, cache, report
3
3
4
4
All models must implement a `fit` method. Here `data` is the
5
5
output of `reformat` on user-provided data, or some some resampling
@@ -16,7 +16,7 @@ fit(::Static, ::Integer, data...) = (nothing, nothing, nothing)
16
16
fit (m:: Supervised , verbosity, X, y, w) = fit (m, verbosity, X, y)
17
17
18
18
"""
19
- update(model, verbosity, fitresult, cache, data...)
19
+ MLJModelInterface. update(model, verbosity, fitresult, cache, data...)
20
20
21
21
Models may optionally implement an `update` method. The fallback calls
22
22
`fit`.
@@ -25,6 +25,20 @@ Models may optionally implement an `update` method. The fallback calls
25
25
update (m:: Model , verbosity, fitresult, cache, data... ) =
26
26
fit (m, verbosity, data... )
27
27
28
+ """
29
+ MLJModelInterface.training_losses(model::M, report)
30
+
31
+ If `M` is an iterative model type which calculates training losses,
32
+ implement this method to return an `AbstractVector` of the losses
33
+ in historical order. If the model calculates scores instead, then the
34
+ sign of the scores should be reversed.
35
+
36
+ The following trait overload is alse required:
37
+ `supports_training_losses(::Type{<:M}) = true`
38
+
39
+ """
40
+ training_losses (model, report) = nothing
41
+
28
42
# to support online learning in the future:
29
43
# https://github.com/alan-turing-institute/MLJ.jl/issues/60 :
30
44
function update_data end
@@ -53,7 +67,7 @@ manual](https://alan-turing-institute.github.io/MLJ.jl/dev/adding_models_for_gen
53
67
reformat (model:: Model , args... ) = args
54
68
55
69
"""
56
- selectrows(::Model, I, data...) -> sampled_data
70
+ MLJModelInterface. selectrows(::Model, I, data...) -> sampled_data
57
71
58
72
A model overloads `selectrows` whenever it buys into the optional
59
73
`reformat` front-end for data preprocessing. See [`reformat`](@ref)
0 commit comments