Skip to content

Commit 73dfc4e

Browse files
authored
Merge pull request #41 from DilumAluthge/dpa/docstrings
Change some comments into proper docstrings
2 parents 9cf959d + ceaf390 commit 73dfc4e

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

src/model_api.jl

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
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+
"""
35
function fit end
46

57
# fallback for static transformations
@@ -12,29 +14,52 @@ fit(m::Supervised, verb::Integer, X, y, w) = fit(m, verb, X, y)
1214
# fitted parameters (eg, coeficients of linear model):
1315
fitted_params(::Model, fitres) = (fitresult=fitres,)
1416

15-
# each model interface may overload the following refitting method:
17+
"""
18+
each model interface may overload the `update` refitting method
19+
"""
1620
update(m::Model, verb::Integer, fitres, cache, a...) = fit(m, verb, a...)
1721

18-
# stub for online learning method update method
22+
"""
23+
each model interface may overload the `update_data` refitting method for online learning
24+
"""
1925
function update_data end
2026

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`
27+
"""
28+
supervised methods must implement the `predict` operation
29+
"""
2430
function predict end
31+
32+
"""
33+
probabilistic supervised models may overload `predict_mean`
34+
"""
2535
function predict_mean end
36+
37+
"""
38+
probabilistic supervised models may overload `predict_mode`
39+
"""
2640
function predict_mode end
41+
42+
"""
43+
probabilistic supervised models may overload `predict_median`
44+
"""
2745
function predict_median end
2846

29-
# unsupervised methods must implement the transform operation and
30-
# may implement the inverse_transform operation
47+
"""
48+
unsupervised methods must implement the `transform` operation
49+
"""
3150
function transform end
51+
52+
"""
53+
unsupervised methods may implement the `inverse_transform` operation
54+
"""
3255
function inverse_transform end
3356

3457
# models can optionally overload these for enable serialization in a
3558
# custom format:
3659
function save end
3760
function restore end
3861

39-
# operations implemented by some meta-models:
62+
"""
63+
some meta-models may choose to implement the `evaluate` operations
64+
"""
4065
function evaluate end

0 commit comments

Comments
 (0)