Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MLJ docstrings #141

Merged
merged 1 commit into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/mlj/classifiers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ See also [`MultinomialClassifier`](@ref).
"""some instance of `MLJLinearModels.S` where `S` is one of: `LBFGS`, `Newton`,
`NewtonCG`, `ProxGrad`; but subject to the following restrictions:

- If `gamma > 0` (L1 norm penalized) then only `ProxGrad` is allowed.
- If `penalty = :l2`, `ProxGrad` is disallowed. Otherwise, `ProxyGrad` is the only
option.

- Unless `scitype(y) <: Finite{2}` (binary target) `Newton` is disallowed.

Expand Down Expand Up @@ -141,7 +142,8 @@ See also [`LogisticClassifier`](@ref).
"""some instance of `MLJLinearModels.S` where `S` is one of: `LBFGS`,
`NewtonCG`, `ProxGrad`; but subject to the following restrictions:

- If `gamma > 0` (L1 norm penalized) then `ProxGrad` is disallowed.
- If `penalty = :l2`, `ProxGrad` is disallowed. Otherwise, `ProxyGrad` is the only
option.

- Unless `scitype(y) <: Finite{2}` (binary target) `Newton` is disallowed.

Expand Down
28 changes: 12 additions & 16 deletions src/mlj/regressors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,10 @@ See also [`HuberRegressor`](@ref), [`QuantileRegressor`](@ref).
"whether to scale the penalty with the number of observations."
scale_penalty_with_samples::Bool = true
"""some instance of `MLJLinearModels.S` where `S` is one of: `LBFGS`, `IWLSCG`,
`Newton`, `NewtonCG`, `ProxGrad`, unless `gamma > 0` (L1 norm penalized) in which
case only `ProxGrad` solvers are allowed.
`Newton`, `NewtonCG`, if `penalty = :l2`, and `ProxGrad` otherwise.

If `solver = nothing` (default) then `ProxGrad(accel=true)` (FISTA) is used,
unless `gamma = 0`, in which case `LBFGS()` is used.
If `solver = nothing` (default) then `LBFGS()` is used, if `penalty = :l2`, and
otherwise `ProxGrad(accel=true)` (FISTA) is used.

Solver aliases: `FISTA(; kwargs...) = ProxGrad(accel=true, kwargs...)`,
`ISTA(; kwargs...) = ProxGrad(accel=false, kwargs...)`"""
Expand Down Expand Up @@ -398,11 +397,10 @@ See also [`RobustRegressor`](@ref), [`QuantileRegressor`](@ref).
"whether to scale the penalty with the number of observations."
scale_penalty_with_samples::Bool = true
"""some instance of `MLJLinearModels.S` where `S` is one of: `LBFGS`, `IWLSCG`,
`Newton`, `NewtonCG`, `ProxGrad`, unless `gamma > 0` (L1 norm penalized) in which
case only `ProxGrad` solvers are allowed.
`Newton`, `NewtonCG`, if `penalty = :l2`, and `ProxGrad` otherwise.

If `solver = nothing` (default) then `ProxGrad(accel=true)` (FISTA) is used,
unless `gamma = 0`, in which case `LBFGS()` is used.
If `solver = nothing` (default) then `LBFGS()` is used, if `penalty = :l2`, and
otherwise `ProxGrad(accel=true)` (FISTA) is used.

Solver aliases: `FISTA(; kwargs...) = ProxGrad(accel=true, kwargs...)`,
`ISTA(; kwargs...) = ProxGrad(accel=false, kwargs...)`"""
Expand Down Expand Up @@ -473,11 +471,10 @@ See also [`RobustRegressor`](@ref), [`HuberRegressor`](@ref).
"whether to scale the penalty with the number of observations."
scale_penalty_with_samples::Bool = true
"""some instance of `MLJLinearModels.S` where `S` is one of: `LBFGS`, `IWLSCG`,
`ProxGrad`, unless `gamma > 0` (L1 norm penalized) in which case only
`ProxGrad` solvers are allowed.
if `penalty = :l2`, and `ProxGrad` otherwise.

If `solver = nothing` (default) then `ProxGrad(accel=true)` (FISTA) is used,
unless `gamma = 0`, in which case `LBFGS()` is used.
If `solver = nothing` (default) then `LBFGS()` is used, if `penalty = :l2`, and
otherwise `ProxGrad(accel=true)` (FISTA) is used.

Solver aliases: `FISTA(; kwargs...) = ProxGrad(accel=true, kwargs...)`,
`ISTA(; kwargs...) = ProxGrad(accel=false, kwargs...)`"""
Expand Down Expand Up @@ -553,11 +550,10 @@ $(example_docstring("LADRegressor"))
"whether to scale the penalty with the number of observations."
scale_penalty_with_samples::Bool = true
"""some instance of `MLJLinearModels.S` where `S` is one of: `LBFGS`, `IWLSCG`,
`ProxGrad`, unless `gamma > 0` (L1 norm penalized) in which case only
`ProxGrad` solvers are allowed.
if `penalty = :l2`, and `ProxGrad` otherwise.

If `solver = nothing` (default) then `ProxGrad(accel=true)` (FISTA) is used,
unless `gamma = 0`, in which case `LBFGS()` is used.
If `solver = nothing` (default) then `LBFGS()` is used, if `penalty = :l2`, and
otherwise `ProxGrad(accel=true)` (FISTA) is used.

Solver aliases: `FISTA(; kwargs...) = ProxGrad(accel=true, kwargs...)`,
`ISTA(; kwargs...) = ProxGrad(accel=false, kwargs...)`"""
Expand Down