Skip to content

Commit

Permalink
build based on d59c534
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Dec 6, 2023
1 parent b2de615 commit 506fc41
Show file tree
Hide file tree
Showing 30 changed files with 55 additions and 55 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-06T21:03:03","documenter_version":"1.2.1"}}
{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-06T21:04:19","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}:
3.383262748599054
2.2021162759325157
1.8460436943500325
1.2382024128827007</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
3.2851307174491957
3.4059447153374394
2.0001200038065257
0.4640217197360189</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.895211869005642, :b =&gt; 0.2614999229322508, :c =&gt; 1.9713422018424942]</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.895211869005642
:b =&gt; 0.2614999229322508
:c =&gt; 1.9713422018424942</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.3465903834309796, :b =&gt; -0.09568209492212103, :c =&gt; 2.353648142835128]</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.3465903834309796
:b =&gt; -0.09568209492212103
:c =&gt; 2.353648142835128</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="Wednesday 6 December 2023 21:03">Wednesday 6 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="Wednesday 6 December 2023 21:04">Wednesday 6 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 506fc41

Please sign in to comment.