Skip to content

Commit

Permalink
deploy: 1739bbd
Browse files Browse the repository at this point in the history
  • Loading branch information
jitingxu1 committed Sep 16, 2024
1 parent a70abb3 commit 7313ed4
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 108 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -258,22 +258,22 @@ <h3 class="anchored" data-anchor-id="install-ibisml">Install IbisML</h3>
<section id="create-your-first-recipe" class="level3">
<h3 class="anchored" data-anchor-id="create-your-first-recipe">Create your first recipe</h3>
<p>With recipes, you can define sequences of feature engineering steps to get your data ready for modeling. For example, create a recipe to replace missing values using the mean of each numeric column and then normalize numeric data to have a standard deviation of one and a mean of zero.</p>
<div id="7830dda5" class="cell" data-execution_count="1">
<div id="e0dfb661" class="cell" data-execution_count="1">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> ibis_ml <span class="im">as</span> ml</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>imputer <span class="op">=</span> ml.ImputeMean(ml.numeric())</span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a>scaler <span class="op">=</span> ml.ScaleStandard(ml.numeric())</span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a>rec <span class="op">=</span> ml.Recipe(imputer, scaler)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>A recipe can be chained in a <a href="https://scikit-learn.org/stable/modules/generated/sklearn.pipeline.Pipeline.html"><code>Pipeline</code></a> like any other <a href="https://scikit-learn.org/stable/glossary.html#term-transformer">transformer</a>.</p>
<div id="9f7fc087" class="cell" data-execution_count="2">
<div id="72b6a3e6" class="cell" data-execution_count="2">
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> sklearn.pipeline <span class="im">import</span> Pipeline</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> sklearn.svm <span class="im">import</span> SVC</span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a>pipe <span class="op">=</span> Pipeline([(<span class="st">"rec"</span>, rec), (<span class="st">"svc"</span>, SVC())])</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>The pipeline can be used as any other estimator and avoids leaking the test set into the train set.</p>
<div id="344e853f" class="cell" data-execution_count="3">
<div id="31e90b1d" class="cell" data-execution_count="3">
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> sklearn.datasets <span class="im">import</span> make_classification</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> sklearn.model_selection <span class="im">import</span> train_test_split</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a></span>
Expand Down
6 changes: 3 additions & 3 deletions reference/support-matrix/index.html

Large diffs are not rendered by default.

Loading

0 comments on commit 7313ed4

Please # to comment.