Skip to content

Commit f6d7f51

Browse files
committed
Add missing docstrings
1 parent 4dd64e2 commit f6d7f51

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

src/StatsLearnModels.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ export
3838
GeneralizedLinearRegressor,
3939

4040
# DecisionTree.jl
41-
AdaBoostStumpClassifier,
4241
DecisionTreeClassifier,
43-
RandomForestClassifier,
4442
DecisionTreeRegressor,
43+
RandomForestClassifier,
4544
RandomForestRegressor,
45+
AdaBoostStumpClassifier,
4646

4747
# transform
4848
Learn

src/models/glm.jl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,33 @@
44

55
abstract type GLMModel end
66

7+
"""
8+
LinearRegressor(; kwargs...)
9+
10+
Linear regression model.
11+
12+
The `kwargs` are forwarded to the `GLM.lm` function
13+
from [GLM.jl](https://github.com/JuliaStats/GLM.jl).
14+
15+
See also [`GeneralizedLinearRegressor`](@ref).
16+
"""
717
struct LinearRegressor{K} <: GLMModel
818
kwargs::K
919
end
1020

1121
LinearRegressor(; kwargs...) = LinearRegressor(values(kwargs))
1222

23+
"""
24+
GeneralizedLinearRegressor(dist, link; kwargs...)
25+
26+
Generalized linear regression model with distribution `dist`
27+
from Distributions.jl and `link` function.
28+
29+
The `kwargs` are forwarded to the `GLM.glm` function
30+
from [GLM.jl](https://github.com/JuliaStats/GLM.jl).
31+
32+
See also [`LinearRegressor`](@ref).
33+
"""
1334
struct GeneralizedLinearRegressor{D<:UnivariateDistribution,L<:Union{GLM.Link,Nothing},K} <: GLMModel
1435
dist::D
1536
link::L

src/models/nn.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
abstract type NearestNeighborsModel end
66

7+
"""
8+
KNNClassifier(k, metric=Euclidean(); leafsize=10, reorder=true)
9+
10+
K-nearest neighbor classification model with `k` neighbors
11+
and `metric` from Distances.jl. Optionally, specify the
12+
`leafsize` and `reorder` options for the underlying trees in
13+
[NearestNeighbors.jl](https://github.com/KristofferC/NearestNeighbors.jl).
14+
15+
See also [`KNNRegressor`](@ref).
16+
"""
717
struct KNNClassifier{M<:Metric} <: NearestNeighborsModel
818
k::Int
919
metric::M
@@ -13,6 +23,16 @@ end
1323

1424
KNNClassifier(k, metric=Euclidean(); leafsize=10, reorder=true) = KNNClassifier(k, metric, leafsize, reorder)
1525

26+
"""
27+
KNNRegressor(k, metric=Euclidean(); leafsize=10, reorder=true)
28+
29+
K-nearest neighbor regression model with `k` neighbors
30+
and `metric` from Distances.jl. Optionally, specify the
31+
`leafsize` and `reorder` options for the underlying trees in
32+
[NearestNeighbors.jl](https://github.com/KristofferC/NearestNeighbors.jl).
33+
34+
See also [`KNNClassifier`](@ref).
35+
"""
1636
struct KNNRegressor{M<:Metric} <: NearestNeighborsModel
1737
k::Int
1838
metric::M

0 commit comments

Comments
 (0)