-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create MLJ compliant doc strings (#138)
* make doc-strings mlj-compliant
- Loading branch information
Showing
6 changed files
with
472 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const DOC_SOLVERS = | ||
"Different solver options exist, as indicated under "* | ||
"\"Hyperparameters\" below. " | ||
|
||
function example_docstring(m; nclasses = nothing) | ||
""" | ||
## Example | ||
using MLJ | ||
X, y = $(nclasses == nothing ? "make_regression()" : "make_blobs(centers = $nclasses)") | ||
mach = fit!(machine($m(), X, y)) | ||
predict(mach, X) | ||
fitted_params(mach) | ||
""" | ||
end | ||
|
||
function doc_header(ModelType) | ||
name = MLJModelInterface.name(ModelType) | ||
human_name = MLJModelInterface.human_name(ModelType) | ||
|
||
""" | ||
$name | ||
A model type for constructing a $human_name, based on | ||
[MLJLinearModels.jl](https://github.com/alan-turing-institute/MLJLinearModels.jl), and | ||
implementing the MLJ model interface. | ||
From MLJ, the type can be imported using | ||
$name = @load $name pkg=MLJLinearModels | ||
Do `model = $name()` to construct an instance with default | ||
hyper-parameters. | ||
""" | ||
end | ||
|
||
const DOC_PROXGRAD = "Aliases `ISTA` and `FSTA` correspond to "* | ||
"`ProxGrad` with the option `acceleration=false` or `true` respectively. " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.