Skip to content

Commit 19dd48d

Browse files
committed
cosmetic on tuto mean median
1 parent d1323f1 commit 19dd48d

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

docs/api.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,14 @@ Diffusion engine
103103

104104
imputations.imputers_pytorch.ImputerDiffusion
105105
imputations.diffusions.ddpms.TabDDPM
106-
imputations.diffusions.ddpms.TsDDPM
106+
imputations.diffusions.ddpms.TsDDPM
107+
108+
109+
Utils
110+
================
111+
112+
.. autosummary::
113+
:toctree: generated/
114+
:template: function.rst
115+
116+
utils.data.add_holes

examples/tutorials/plot_tuto_diffusion_models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
and :class:`~qolmat.imputations.diffusions.ddpms.TsDDPM` classes.
88
"""
99

10-
# %%
1110
import pandas as pd
1211
import numpy as np
1312
import matplotlib.pyplot as plt

examples/tutorials/plot_tuto_mean_median.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
========================================================================================
3-
Tutorial for comparison between mean and median imputations with uniform hole generation
3+
Comparison of basic imputers
44
========================================================================================
55
66
In this tutorial, we show how to use the Qolmat comparator
@@ -31,11 +31,10 @@
3131
# the 82nd column contains the critical temperature which is used as the
3232
# target variable.
3333
# The data does not contain missing values; so for the purpose of this notebook,
34-
# we corrupt the data, with the ``qolmat.utils.data.add_holes`` function.
34+
# we corrupt the data, with the :func:`qolmat.utils.data.add_holes` function.
3535
# In this way, each column has missing values.
3636

37-
df_data = data.get_data("Superconductor")
38-
df = data.add_holes(df_data, ratio_masked=0.2, mean_size=120)
37+
df = data.add_holes(data.get_data("Superconductor"), ratio_masked=0.2, mean_size=120)
3938

4039
# %%
4140
# The dataset contains 82 columns. For simplicity,
@@ -76,10 +75,6 @@
7675
imputer_median = imputers.ImputerMedian()
7776
dict_imputers = {"mean": imputer_mean, "median": imputer_median}
7877

79-
generator_holes = missing_patterns.UniformHoleGenerator(
80-
n_splits=2, subset=cols_to_impute, ratio_masked=0.1
81-
)
82-
8378
metrics = ["mae", "wmape", "KL_columnwise"]
8479

8580
# %%
@@ -88,9 +83,7 @@
8883
# (those previously mentioned),
8984
# a list with the columns names to impute,
9085
# a generator of holes specifying the type of holes to create.
91-
# Just a few words about hole generation.
9286
# in this example, we have chosen the uniform hole generator.
93-
# You can see what this looks like.
9487
# For example, by imposing that 10% of missing data be created
9588
# ``ratio_masked=0.1`` and creating missing values in columns
9689
# ``subset=cols_to_impute``:

0 commit comments

Comments
 (0)