11"""
2- fit(model, verbosity, data...) -> fitresult, cache, report
2+ MLJModelInterface. fit(model, verbosity, data...) -> fitresult, cache, report
33
44All models must implement a `fit` method. Here `data` is the
55output of `reformat` on user-provided data, or some some resampling
@@ -16,7 +16,7 @@ fit(::Static, ::Integer, data...) = (nothing, nothing, nothing)
1616fit (m:: Supervised , verbosity, X, y, w) = fit (m, verbosity, X, y)
1717
1818"""
19- update(model, verbosity, fitresult, cache, data...)
19+ MLJModelInterface. update(model, verbosity, fitresult, cache, data...)
2020
2121Models may optionally implement an `update` method. The fallback calls
2222`fit`.
@@ -25,6 +25,20 @@ Models may optionally implement an `update` method. The fallback calls
2525update (m:: Model , verbosity, fitresult, cache, data... ) =
2626 fit (m, verbosity, data... )
2727
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+
2842# to support online learning in the future:
2943# https://github.com/alan-turing-institute/MLJ.jl/issues/60 :
3044function update_data end
@@ -53,7 +67,7 @@ manual](https://alan-turing-institute.github.io/MLJ.jl/dev/adding_models_for_gen
5367reformat (model:: Model , args... ) = args
5468
5569"""
56- selectrows(::Model, I, data...) -> sampled_data
70+ MLJModelInterface. selectrows(::Model, I, data...) -> sampled_data
5771
5872A model overloads `selectrows` whenever it buys into the optional
5973`reformat` front-end for data preprocessing. See [`reformat`](@ref)
0 commit comments