Skip to content

Commit

Permalink
build based on 9745ea9
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Dec 4, 2023
1 parent dfc7d68 commit 6bb2439
Show file tree
Hide file tree
Showing 30 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-04T04:42:38","documenter_version":"1.2.1"}}
{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-04T04:43:29","documenter_version":"1.2.1"}}
2 changes: 1 addition & 1 deletion dev/accessor_functions/index.html

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions dev/anatomy_of_an_implementation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,21 @@
LearnAPI.functions(algorithm)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">(LearnAPI.fit, LearnAPI.obsfit, LearnAPI.minimize, LearnAPI.predict, LearnAPI.obspredict, LearnAPI.obs, LearnAPI.algorithm, LearnAPI.coefficients)</code></pre><h3 id="Naive-user-workflow"><a class="docs-heading-anchor" href="#Naive-user-workflow">Naive user workflow</a><a id="Naive-user-workflow-1"></a><a class="docs-heading-anchor-permalink" href="#Naive-user-workflow" title="Permalink"></a></h3><p>Training and predicting with external resampling:</p><pre><code class="language-julia hljs">using Tables
model = fit(algorithm, Tables.subset(X, train), y[train])
ŷ = predict(model, LiteralTarget(), Tables.subset(X, test))</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">4-element Vector{Float64}:
2.3490808668398198
2.1517089413353307
2.558777992913879
1.8737392339073138</code></pre><h3 id="Advanced-workflow"><a class="docs-heading-anchor" href="#Advanced-workflow">Advanced workflow</a><a id="Advanced-workflow-1"></a><a class="docs-heading-anchor-permalink" href="#Advanced-workflow" title="Permalink"></a></h3><p>We now train and predict using internal data representations, resampled using the generic MLUtils.jl interface.</p><pre><code class="language-julia hljs">import MLUtils
1.421736341789303
2.0933286690097486
1.6002307651027934
2.6214993542744587</code></pre><h3 id="Advanced-workflow"><a class="docs-heading-anchor" href="#Advanced-workflow">Advanced workflow</a><a id="Advanced-workflow-1"></a><a class="docs-heading-anchor-permalink" href="#Advanced-workflow" title="Permalink"></a></h3><p>We now train and predict using internal data representations, resampled using the generic MLUtils.jl interface.</p><pre><code class="language-julia hljs">import MLUtils
fit_data = obs(fit, algorithm, X, y)
predict_data = obs(predict, algorithm, X)
model = obsfit(algorithm, MLUtils.getobs(fit_data, train))
ẑ = obspredict(model, LiteralTarget(), MLUtils.getobs(predict_data, test))
@assert ẑ == ŷ</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi"><span class="sgr36"><span class="sgr1">[ Info: </span></span>Coefficients: [:a =&gt; 1.6657166404010904, :b =&gt; -0.07046040662494982, :c =&gt; 1.9034183112632161]</code></pre><h3 id="Applying-an-accessor-function-and-serialization"><a class="docs-heading-anchor" href="#Applying-an-accessor-function-and-serialization">Applying an accessor function and serialization</a><a id="Applying-an-accessor-function-and-serialization-1"></a><a class="docs-heading-anchor-permalink" href="#Applying-an-accessor-function-and-serialization" title="Permalink"></a></h3><p>Extracting coefficients:</p><pre><code class="language-julia hljs">LearnAPI.coefficients(model)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">3-element Vector{Pair{Symbol, Float64}}:
:a =&gt; 1.6657166404010904
:b =&gt; -0.07046040662494982
:c =&gt; 1.9034183112632161</code></pre><p>Serialization/deserialization:</p><pre><code class="language-julia hljs">using Serialization
@assert ẑ == ŷ</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi"><span class="sgr36"><span class="sgr1">[ Info: </span></span>Coefficients: [:a =&gt; 1.876379936697013, :b =&gt; -0.2643309079110383, :c =&gt; 2.2062676491944644]</code></pre><h3 id="Applying-an-accessor-function-and-serialization"><a class="docs-heading-anchor" href="#Applying-an-accessor-function-and-serialization">Applying an accessor function and serialization</a><a id="Applying-an-accessor-function-and-serialization-1"></a><a class="docs-heading-anchor-permalink" href="#Applying-an-accessor-function-and-serialization" title="Permalink"></a></h3><p>Extracting coefficients:</p><pre><code class="language-julia hljs">LearnAPI.coefficients(model)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">3-element Vector{Pair{Symbol, Float64}}:
:a =&gt; 1.876379936697013
:b =&gt; -0.2643309079110383
:c =&gt; 2.2062676491944644</code></pre><p>Serialization/deserialization:</p><pre><code class="language-julia hljs">using Serialization
small_model = minimize(model)
serialize(&quot;my_ridge.jls&quot;, small_model)

recovered_model = deserialize(&quot;my_ridge.jls&quot;)
@assert LearnAPI.algorithm(recovered_model) == algorithm
predict(recovered_model, LiteralTarget(), X) == predict(model, LiteralTarget(), X)</code></pre><hr/><p>¹ The definition of this and other structs above is not an explicit requirement of LearnAPI.jl, whose constructs are purely functional. </p><p>² An implementation can provide further accessor functions, if necessary, but like the native ones, they must be included in the <a href="../traits/#LearnAPI.functions"><code>LearnAPI.functions</code></a> declaration.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../reference/">Reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Monday 4 December 2023 04:42">Monday 4 December 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
predict(recovered_model, LiteralTarget(), X) == predict(model, LiteralTarget(), X)</code></pre><hr/><p>¹ The definition of this and other structs above is not an explicit requirement of LearnAPI.jl, whose constructs are purely functional. </p><p>² An implementation can provide further accessor functions, if necessary, but like the native ones, they must be included in the <a href="../traits/#LearnAPI.functions"><code>LearnAPI.functions</code></a> declaration.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../reference/">Reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Monday 4 December 2023 04:43">Monday 4 December 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/common_implementation_patterns/index.html

Large diffs are not rendered by default.

Loading

0 comments on commit 6bb2439

Please sign in to comment.