Skip to content

Commit

Permalink
[ci skip] DOC Add parameters description for make_synthetic_competing…
Browse files Browse the repository at this point in the history
…_weibull() (#67) 36071a4
  • Loading branch information
Vincent-Maladiere committed Jan 15, 2025
1 parent 7618d94 commit 1d97ee6
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 50 deletions.
Binary file modified .doctrees/auto_examples/plot_01_survival_analysis.doctree
Binary file not shown.
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion _sources/auto_examples/plot_01_survival_analysis.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ doesn't depend on the patient features.
.. rst-class:: sphx-glr-timing

**Total running time of the script:** (0 minutes 9.501 seconds)
**Total running time of the script:** (0 minutes 9.918 seconds)


.. _sphx_glr_download_auto_examples_plot_01_survival_analysis.py:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,17 +277,17 @@ theoretical CIFs:

.. code-block:: none
Integrated theoretical any event survival curve in 0.676 s
Integrated theoretical any event survival curve in 0.643 s
/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/sklearn/utils/deprecation.py:151: FutureWarning: 'force_all_finite' was renamed to 'ensure_all_finite' in 1.6 and will be removed in 1.8.
warnings.warn(
SurvivalBoost fit: 4.093 s
SurvivalBoost prediction: 2.934 s
Integrated theoretical cumulative incidence curve for event 1 in 2.995 s
Aalen-Johansen for event 1 fit in 5.076 s
Integrated theoretical cumulative incidence curve for event 2 in 5.178 s
Aalen-Johansen for event 2 fit in 5.082 s
Integrated theoretical cumulative incidence curve for event 3 in 5.163 s
Aalen-Johansen for event 3 fit in 5.051 s
SurvivalBoost fit: 4.280 s
SurvivalBoost prediction: 3.026 s
Integrated theoretical cumulative incidence curve for event 1 in 3.086 s
Aalen-Johansen for event 1 fit in 5.279 s
Integrated theoretical cumulative incidence curve for event 2 in 5.378 s
Aalen-Johansen for event 2 fit in 5.403 s
Integrated theoretical cumulative incidence curve for event 3 in 5.485 s
Aalen-Johansen for event 3 fit in 5.278 s
Expand Down Expand Up @@ -330,17 +330,17 @@ of censoring.

.. code-block:: none
Integrated theoretical any event survival curve in 0.589 s
Integrated theoretical any event survival curve in 0.586 s
/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/sklearn/utils/deprecation.py:151: FutureWarning: 'force_all_finite' was renamed to 'ensure_all_finite' in 1.6 and will be removed in 1.8.
warnings.warn(
SurvivalBoost fit: 4.198 s
SurvivalBoost prediction: 2.943 s
Integrated theoretical cumulative incidence curve for event 1 in 3.003 s
Aalen-Johansen for event 1 fit in 5.047 s
Integrated theoretical cumulative incidence curve for event 2 in 5.143 s
Aalen-Johansen for event 2 fit in 5.012 s
Integrated theoretical cumulative incidence curve for event 3 in 5.097 s
Aalen-Johansen for event 3 fit in 5.057 s
SurvivalBoost fit: 4.237 s
SurvivalBoost prediction: 2.978 s
Integrated theoretical cumulative incidence curve for event 1 in 3.038 s
Aalen-Johansen for event 1 fit in 5.367 s
Integrated theoretical cumulative incidence curve for event 2 in 5.465 s
Aalen-Johansen for event 2 fit in 5.302 s
Integrated theoretical cumulative incidence curve for event 3 in 5.383 s
Aalen-Johansen for event 3 fit in 5.286 s
Expand All @@ -364,7 +364,7 @@ the large time horizons:

.. rst-class:: sphx-glr-timing

**Total running time of the script:** (0 minutes 46.561 seconds)
**Total running time of the script:** (0 minutes 48.462 seconds)


.. _sphx_glr_download_auto_examples_plot_02_marginal_cumulative_incidence_estimation.py:
Expand Down
2 changes: 1 addition & 1 deletion auto_examples/plot_01_survival_analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ <h2>Survival model evaluation<a class="headerlink" href="#survival-model-evaluat
<div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>Concordance index for SurvivalBoost: 0.67
</pre></div>
</div>
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> (0 minutes 9.501 seconds)</p>
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> (0 minutes 9.918 seconds)</p>
<div class="sphx-glr-footer sphx-glr-footer-example docutils container" id="sphx-glr-download-auto-examples-plot-01-survival-analysis-py">
<div class="sphx-glr-download sphx-glr-download-jupyter docutils container">
<p><a class="reference download internal" download="" href="../_downloads/a6916f06450964ef8d10eb5f311100d1/plot_01_survival_analysis.ipynb"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Jupyter</span> <span class="pre">notebook:</span> <span class="pre">plot_01_survival_analysis.ipynb</span></code></a></p>
Expand Down
38 changes: 19 additions & 19 deletions auto_examples/plot_02_marginal_cumulative_incidence_estimation.html
Original file line number Diff line number Diff line change
Expand Up @@ -564,17 +564,17 @@ <h2>CIFs estimated on uncensored data<a class="headerlink" href="#cifs-estimated
<span class="p">)</span>
</pre></div>
</div>
<img src="../_images/sphx_glr_plot_02_marginal_cumulative_incidence_estimation_001.png" srcset="../_images/sphx_glr_plot_02_marginal_cumulative_incidence_estimation_001.png" alt="Cause-specific cumulative incidence functions (0.0% censoring), Event 1, Event 2, Event 3" class = "sphx-glr-single-img"/><div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>Integrated theoretical any event survival curve in 0.676 s
<img src="../_images/sphx_glr_plot_02_marginal_cumulative_incidence_estimation_001.png" srcset="../_images/sphx_glr_plot_02_marginal_cumulative_incidence_estimation_001.png" alt="Cause-specific cumulative incidence functions (0.0% censoring), Event 1, Event 2, Event 3" class = "sphx-glr-single-img"/><div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>Integrated theoretical any event survival curve in 0.643 s
/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/sklearn/utils/deprecation.py:151: FutureWarning: &#39;force_all_finite&#39; was renamed to &#39;ensure_all_finite&#39; in 1.6 and will be removed in 1.8.
warnings.warn(
SurvivalBoost fit: 4.093 s
SurvivalBoost prediction: 2.934 s
Integrated theoretical cumulative incidence curve for event 1 in 2.995 s
Aalen-Johansen for event 1 fit in 5.076 s
Integrated theoretical cumulative incidence curve for event 2 in 5.178 s
Aalen-Johansen for event 2 fit in 5.082 s
Integrated theoretical cumulative incidence curve for event 3 in 5.163 s
Aalen-Johansen for event 3 fit in 5.051 s
SurvivalBoost fit: 4.280 s
SurvivalBoost prediction: 3.026 s
Integrated theoretical cumulative incidence curve for event 1 in 3.086 s
Aalen-Johansen for event 1 fit in 5.279 s
Integrated theoretical cumulative incidence curve for event 2 in 5.378 s
Aalen-Johansen for event 2 fit in 5.403 s
Integrated theoretical cumulative incidence curve for event 3 in 5.485 s
Aalen-Johansen for event 3 fit in 5.278 s
</pre></div>
</div>
</section>
Expand All @@ -597,17 +597,17 @@ <h2>CIFs estimated on censored data<a class="headerlink" href="#cifs-estimated-o
<span class="n">plot_cumulative_incidence_functions</span><span class="p">(</span><a href="../generated/hazardous.SurvivalBoost.html#hazardous.SurvivalBoost" title="hazardous.SurvivalBoost" class="sphx-glr-backref-module-hazardous sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">survival_boost</span></a><span class="o">=</span><a href="../generated/hazardous.SurvivalBoost.html#hazardous.SurvivalBoost" title="hazardous.SurvivalBoost" class="sphx-glr-backref-module-hazardous sphx-glr-backref-type-py-class sphx-glr-backref-instance"><span class="n">survival_boost</span></a><span class="p">,</span> <span class="n">aj</span><span class="o">=</span><span class="n">aj</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">y_censored</span><span class="p">)</span>
</pre></div>
</div>
<img src="../_images/sphx_glr_plot_02_marginal_cumulative_incidence_estimation_002.png" srcset="../_images/sphx_glr_plot_02_marginal_cumulative_incidence_estimation_002.png" alt="Cause-specific cumulative incidence functions (40.4% censoring), Event 1, Event 2, Event 3" class = "sphx-glr-single-img"/><div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>Integrated theoretical any event survival curve in 0.589 s
<img src="../_images/sphx_glr_plot_02_marginal_cumulative_incidence_estimation_002.png" srcset="../_images/sphx_glr_plot_02_marginal_cumulative_incidence_estimation_002.png" alt="Cause-specific cumulative incidence functions (40.4% censoring), Event 1, Event 2, Event 3" class = "sphx-glr-single-img"/><div class="sphx-glr-script-out highlight-none notranslate"><div class="highlight"><pre><span></span>Integrated theoretical any event survival curve in 0.586 s
/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/sklearn/utils/deprecation.py:151: FutureWarning: &#39;force_all_finite&#39; was renamed to &#39;ensure_all_finite&#39; in 1.6 and will be removed in 1.8.
warnings.warn(
SurvivalBoost fit: 4.198 s
SurvivalBoost prediction: 2.943 s
Integrated theoretical cumulative incidence curve for event 1 in 3.003 s
Aalen-Johansen for event 1 fit in 5.047 s
Integrated theoretical cumulative incidence curve for event 2 in 5.143 s
Aalen-Johansen for event 2 fit in 5.012 s
Integrated theoretical cumulative incidence curve for event 3 in 5.097 s
Aalen-Johansen for event 3 fit in 5.057 s
SurvivalBoost fit: 4.237 s
SurvivalBoost prediction: 2.978 s
Integrated theoretical cumulative incidence curve for event 1 in 3.038 s
Aalen-Johansen for event 1 fit in 5.367 s
Integrated theoretical cumulative incidence curve for event 2 in 5.465 s
Aalen-Johansen for event 2 fit in 5.302 s
Integrated theoretical cumulative incidence curve for event 3 in 5.383 s
Aalen-Johansen for event 3 fit in 5.286 s
</pre></div>
</div>
<p>Note that the Aalen-Johansen estimator is unbiased and empirically recovers
Expand All @@ -622,7 +622,7 @@ <h2>CIFs estimated on censored data<a class="headerlink" href="#cifs-estimated-o
<p>Alternatively, we could try to enable a monotonicity constraint at training
time, however, in practice this often causes a sever over-estimation bias for
the large time horizons:</p>
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> (0 minutes 46.561 seconds)</p>
<p class="sphx-glr-timing"><strong>Total running time of the script:</strong> (0 minutes 48.462 seconds)</p>
<div class="sphx-glr-footer sphx-glr-footer-example docutils container" id="sphx-glr-download-auto-examples-plot-02-marginal-cumulative-incidence-estimation-py">
<div class="sphx-glr-download sphx-glr-download-jupyter docutils container">
<p><a class="reference download internal" download="" href="../_downloads/8da6be5df74b4f584c69dbcd5de4f948/plot_02_marginal_cumulative_incidence_estimation.ipynb"><code class="xref download docutils literal notranslate"><span class="pre">Download</span> <span class="pre">Jupyter</span> <span class="pre">notebook:</span> <span class="pre">plot_02_marginal_cumulative_incidence_estimation.ipynb</span></code></a></p>
Expand Down
59 changes: 50 additions & 9 deletions generated/hazardous.data.make_synthetic_competing_weibull.html
Original file line number Diff line number Diff line change
Expand Up @@ -390,17 +390,58 @@ <h1><code class="xref py py-mod docutils literal notranslate"><span class="pre">
different range of shape and scale parameters.</p>
<p>Then we sample event durations for each event type from the corresponding
Weibull distribution parametrized by the sampled shape and scale
parameters.</p>
<p>The shape and scale parameters are returned as features. For each
individual, the event type with the shortest duration is kept as the target
event (competing risks setting) and its event identifier and duration are
returned as the target dataframe.</p>
<p>A fraction of the individuals are censored by sampling a censoring time
from a Weibull distribution with shape 1 and scale equal to the mean
duration of the target event times the <code class="docutils literal notranslate"><span class="pre">censoring_relative_scale</span></code>.</p>
<p>Setting <code class="docutils literal notranslate"><span class="pre">censoring_relative_scale</span></code> to 0 or None disables censoring.
parameters. The shape and scale parameters are returned as features.</p>
<p>Then, we apply the same procedure to sample the duration for the censoring
event (event = 0) if <code class="docutils literal notranslate"><span class="pre">censoring_relative_scale</span></code> is not None or 0.</p>
<p>For each individual, the event type with the shortest duration is kept as
the target event (competing risks setting) and its event identifier and
duration are returned as the target dataframe.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>n_events: int, default=3</strong></dt><dd><p>Number of events of interest.</p>
</dd>
<dt><strong>n_samples: int, default=3000</strong></dt><dd><p>Number of individuals in the population.</p>
</dd>
<dt><strong>return_X_y: bool, default=False</strong></dt><dd><p>If True, returns <code class="docutils literal notranslate"><span class="pre">(data,</span> <span class="pre">target)</span></code> instead of a Bunch object.</p>
</dd>
<dt><strong>feature_rounding: int or None, default=2</strong></dt><dd><p>Round the feature values. If None, no rounding will be applied.</p>
</dd>
<dt><strong>target_rounding: int or None, default=1</strong></dt><dd><p>Round the column duration of the target. If None, no rounding will
be applied.</p>
</dd>
<dt><strong>shape_ranges: tuple of shape (n_events, 2)</strong></dt><dd><p>The lower and upper boundary of the shape, <cite>n_samples</cite> shape
values for <cite>n_events</cite> will be drawn from a uniform distribution.</p>
</dd>
<dt><strong>scale_ranges: tuple of shape (n_events, 2)</strong></dt><dd><p>The lower and upper boundary of the scale, <cite>n_samples</cite> scale
values for <cite>n_events</cite> will be drawn from a uniform distribution.</p>
</dd>
<dt><strong>base_scale: int, default=1000</strong></dt><dd><p>Scaling parameter of the <code class="docutils literal notranslate"><span class="pre">scale_range</span></code>.</p>
</dd>
<dt><strong>censoring_relative_scale: float, default=1.5</strong></dt><dd><p>Relative scale of the censoring level. Individuals are censored by
sampling a censoring time from a Weibull distribution with shape 1
and scale equal to the mean duration of the target event times
the <code class="docutils literal notranslate"><span class="pre">censoring_relative_scale</span></code>.
Setting <code class="docutils literal notranslate"><span class="pre">censoring_relative_scale</span></code> to 0 or None disables censoring.
Setting it to a small value (e.g. 0.5 instead of 1.5) will result in a
larger fraction of censored individuals.</p>
</dd>
<dt><strong>random_state</strong><span class="classifier">int, RandomState instance or None, default=None</span></dt><dd><p>Controls the randomness of the uniform time sampler.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><dl class="simple">
<dt>(data, target): tuple if <code class="docutils literal notranslate"><span class="pre">return_X_y</span></code> is True</dt><dd><p>A tuple of two dataframes. The first containing a 2D array of shape
(n_samples, n_features) with each row representing one sample
and each column representing the features. The second dataframe
of shape (n_samples, 2) containing the target samples. The first
column contains the event identifier (event = 0 represents the censoring
event) and the second column contains the duration of the target event.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>

<div class="clearer"></div></section>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 1d97ee6

Please sign in to comment.