Skip to content

Commit

Permalink
build based on b53d2fd
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed May 10, 2024
1 parent 813027c commit 3f05fde
Show file tree
Hide file tree
Showing 34 changed files with 599 additions and 438 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:23:55","documenter_version":"1.2.1"}}
{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-05-10T03:13:33","documenter_version":"1.4.1"}}
4 changes: 2 additions & 2 deletions 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}:
1.3923271715113514
0.9897274455080671
1.0833712608796564
2.284815067968779</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
2.035030476492935
3.1348335720184357
1.1359846628809618
2.8785342355493695</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.9764593532693593, :b =&gt; -0.44874600614288557, :c =&gt; 0.9467477933434958]</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.9764593532693593
:b =&gt; -0.44874600614288557
:c =&gt; 0.9467477933434958</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.9054811886298182, :b =&gt; 0.3178672991278192, :c =&gt; 1.7868493089298811]</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.9054811886298182
:b =&gt; 0.3178672991278192
:c =&gt; 1.7868493089298811</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:23">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="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Friday 10 May 2024 03:13">Friday 10 May 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 3f05fde

Please sign in to comment.