Skip to content

Commit

Permalink
fix docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
ablaom committed Feb 1, 2023
1 parent 9d98288 commit 7109243
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
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

0 comments on commit 7109243

Please sign in to comment.