1
- # every model interface must implement a `fit` method of the form
2
- # `fit(model, verb::Integer, training_args...) -> fitresult, cache, report`
1
+ """
2
+ every model interface must implement a `fit` method of the form
3
+ `fit(model, verb::Integer, training_args...) -> fitresult, cache, report`
4
+ """
3
5
function fit end
4
6
5
7
# fallback for static transformations
@@ -8,33 +10,65 @@ fit(::Static, ::Integer, a...) = (nothing, nothing, nothing)
8
10
# fallbacks for supervised models that don't support sample weights:
9
11
fit (m:: Supervised , verb:: Integer , X, y, w) = fit (m, verb, X, y)
10
12
11
- # this operation can be optionally overloaded to provide access to
12
- # fitted parameters (eg, coeficients of linear model):
13
+ """
14
+ `fitted_params` can be optionally overloaded to provide access to
15
+ fitted parameters (eg, coeficients of linear model):
16
+ """
13
17
fitted_params (:: Model , fitres) = (fitresult= fitres,)
14
18
15
- # each model interface may overload the following refitting method:
19
+ """
20
+ each model interface may overload the `update` refitting method
21
+ """
16
22
update (m:: Model , verb:: Integer , fitres, cache, a... ) = fit (m, verb, a... )
17
23
18
- # stub for online learning method update method
24
+ """
25
+ each model interface may overload the `update_data` refitting method for online learning
26
+ """
19
27
function update_data end
20
28
21
- # supervised methods must implement the predict operation; additionally,
22
- # probabilistic supervised models may overload one or more of
23
- # `predict_mode`, `predict_median` and `predict_mean`
29
+ """
30
+ supervised methods must implement the `predict` operation
31
+ """
24
32
function predict end
33
+
34
+ """
35
+ probabilistic supervised models may overload `predict_mean`
36
+ """
25
37
function predict_mean end
38
+
39
+ """
40
+ probabilistic supervised models may overload `predict_mode`
41
+ """
26
42
function predict_mode end
43
+
44
+ """
45
+ probabilistic supervised models may overload `predict_median`
46
+ """
27
47
function predict_median end
28
48
29
- # unsupervised methods must implement the transform operation and
30
- # may implement the inverse_transform operation
49
+ """
50
+ unsupervised methods must implement the `transform` operation
51
+ """
31
52
function transform end
53
+
54
+ """
55
+ unsupervised methods may implement the `inverse_transform` operation
56
+ """
32
57
function inverse_transform end
33
58
34
- # models can optionally overload these for enable serialization in a
35
- # custom format:
59
+ """
60
+ models can optionally overload `save` to enable serialization in a
61
+ custom format
62
+ """
36
63
function save end
64
+
65
+ """
66
+ models can optionally overload `restore` to enable serialization in a
67
+ custom format
68
+ """
37
69
function restore end
38
70
39
- # operations implemented by some meta-models:
71
+ """
72
+ some meta-models may choose to implement the `evaluate` operations
73
+ """
40
74
function evaluate end
0 commit comments