Skip to content

Commit

Permalink
Deployed dc04f6e with MkDocs version: 1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsWinter committed Dec 10, 2024
1 parent a07f5e1 commit 21cc73d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
25 changes: 1 addition & 24 deletions examples/simulated_data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -642,30 +642,7 @@

<h1>Simulated Data</h1>

<div class="highlight"><span class="filename">Python</span><pre><span></span><code><span class="kn">from</span> <span class="nn">sklearn.model_selection</span> <span class="kn">import</span> <span class="n">KFold</span><span class="p">,</span> <span class="n">ShuffleSplit</span>

<span class="kn">from</span> <span class="nn">cpm</span> <span class="kn">import</span> <span class="n">CPMRegression</span>
<span class="kn">from</span> <span class="nn">cpm.simulate_data</span> <span class="kn">import</span> <span class="n">simulate_regression_data</span>
<span class="kn">from</span> <span class="nn">cpm.edge_selection</span> <span class="kn">import</span> <span class="n">PThreshold</span><span class="p">,</span> <span class="n">UnivariateEdgeSelection</span>


<span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">covariates</span> <span class="o">=</span> <span class="n">simulate_regression_data</span><span class="p">(</span><span class="n">n_features</span><span class="o">=</span><span class="mi">1225</span><span class="p">,</span> <span class="n">n_informative_features</span><span class="o">=</span><span class="mi">50</span><span class="p">,</span>
<span class="n">covariate_effect_size</span><span class="o">=</span><span class="mf">0.2</span><span class="p">,</span>
<span class="n">feature_effect_size</span><span class="o">=</span><span class="mi">100</span><span class="p">,</span>
<span class="n">noise_level</span><span class="o">=</span><span class="mf">0.1</span><span class="p">)</span>

<span class="n">univariate_edge_selection</span> <span class="o">=</span> <span class="n">UnivariateEdgeSelection</span><span class="p">(</span><span class="n">edge_statistic</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;pearson&#39;</span><span class="p">],</span>
<span class="n">edge_selection</span><span class="o">=</span><span class="p">[</span><span class="n">PThreshold</span><span class="p">(</span><span class="n">threshold</span><span class="o">=</span><span class="p">[</span><span class="mf">0.05</span><span class="p">],</span>
<span class="n">correction</span><span class="o">=</span><span class="p">[</span><span class="kc">None</span><span class="p">])])</span>
<span class="n">cpm</span> <span class="o">=</span> <span class="n">CPMRegression</span><span class="p">(</span><span class="n">results_directory</span><span class="o">=</span><span class="s1">&#39;./tmp/example_simulated_data2&#39;</span><span class="p">,</span>
<span class="n">cv</span><span class="o">=</span><span class="n">KFold</span><span class="p">(</span><span class="n">n_splits</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">shuffle</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">random_state</span><span class="o">=</span><span class="mi">42</span><span class="p">),</span>
<span class="n">edge_selection</span><span class="o">=</span><span class="n">univariate_edge_selection</span><span class="p">,</span>
<span class="c1">#cv_edge_selection=ShuffleSplit(n_splits=1, test_size=0.2, random_state=42),</span>
<span class="n">add_edge_filter</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">n_permutations</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
<span class="n">cpm</span><span class="o">.</span><span class="n">estimate</span><span class="p">(</span><span class="n">X</span><span class="o">=</span><span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">y</span><span class="p">,</span> <span class="n">covariates</span><span class="o">=</span><span class="n">covariates</span><span class="p">)</span>

<span class="c1">#cpm._calculate_permutation_results(&#39;./tmp/example_simulated_data2&#39;)</span>
<div class="highlight"><span class="filename">Python</span><pre><span></span><code>
</code></pre></div>


Expand Down
Loading

0 comments on commit 21cc73d

Please sign in to comment.