Skip to content

Commit b069a9a

Browse files
authored
renaming, issue #294 (#299)
Addressed issue #294 about changing every occurence of "concept_drift" to "conditional_shift" Also changed "concept drift" to "conditional shift" in docstrings
1 parent 14f20fe commit b069a9a

24 files changed

+86
-81
lines changed

conftest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def da_reg_dataset():
2626
return make_shifted_datasets(
2727
n_samples_source=20,
2828
n_samples_target=21,
29-
shift="concept_drift",
29+
shift="conditional_shift",
3030
mean=0.5,
3131
noise=0.3,
3232
label="regression",
@@ -40,7 +40,7 @@ def da_reg_datasets():
4040
da_reg_dataset_1 = make_shifted_datasets(
4141
n_samples_source=5,
4242
n_samples_target=10,
43-
shift="concept_drift",
43+
shift="conditional_shift",
4444
mean=0.5,
4545
noise=0.3,
4646
label="regression",
@@ -51,7 +51,7 @@ def da_reg_datasets():
5151
da_reg_dataset_2 = make_shifted_datasets(
5252
n_samples_source=10,
5353
n_samples_target=5,
54-
shift="concept_drift",
54+
shift="conditional_shift",
5555
mean=0.5,
5656
noise=0.3,
5757
label="regression",
@@ -65,7 +65,7 @@ def da_multiclass_dataset():
6565
return make_shifted_datasets(
6666
n_samples_source=20,
6767
n_samples_target=21,
68-
shift="concept_drift",
68+
shift="conditional_shift",
6969
noise=0.1,
7070
label="multiclass",
7171
random_state=42,
@@ -78,7 +78,7 @@ def da_binary_dataset():
7878
return make_shifted_datasets(
7979
n_samples_source=20,
8080
n_samples_target=21,
81-
shift="concept_drift",
81+
shift="conditional_shift",
8282
noise=0.1,
8383
label="binary",
8484
random_state=42,

examples/datasets/plot_shifted_dataset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This illustrates the :func:`~skada.datasets.make_shifted_dataset`
66
dataset generator. Each method consists of generating source data
77
and shifted target data. We illustrate here:
8-
covariate shift, target shift, concept drift, and sample bias.
8+
covariate shift, target shift, conditional shift, and sample bias.
99
See detailed description of each shift in [1]_.
1010
1111
.. [1] Moreno-Torres, J. G., Raeder, T., Alaiz-Rodriguez,
@@ -27,7 +27,7 @@ def plot_shifted_dataset(shift, random_state=42):
2727
"""Plot source and shifted target data for a given type of shift.
2828
2929
The possible shifts are 'covariate_shift', 'target_shift',
30-
'concept_drift', or 'subspace'.
30+
'conditional_shift', or 'subspace'.
3131
3232
We use here the same random seed for multiple calls to
3333
ensure same distributions.
@@ -88,7 +88,7 @@ def plot_shifted_dataset(shift, random_state=42):
8888
for shift in [
8989
"covariate_shift",
9090
"target_shift",
91-
"concept_drift",
91+
"conditional_shift",
9292
"subspace",
9393
]:
9494
plot_shifted_dataset(shift)

examples/datasets/plot_shifted_dataset_regression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This illustrates the :func:`~skada.datasets.make_shifted_dataset`
66
dataset generator. Each method consists of generating source data
77
and shifted target data. We illustrate here:
8-
covariate shift, target shift, concept drift, and sample bias.
8+
covariate shift, target shift, conditional shift, and sample bias.
99
See detailed description of each shift in [1]_.
1010
1111
.. [1] Moreno-Torres, J. G., Raeder, T., Alaiz-Rodriguez,
@@ -32,7 +32,7 @@ def plot_shifted_dataset(shift, random_state=42):
3232
"""Plot source and shifted target data for a given type of shift.
3333
3434
The possible shifts are 'covariate_shift', 'target_shift',
35-
'concept_drift' or 'subspace'.
35+
'conditional_shift' or 'subspace'.
3636
3737
We use here the same random seed for multiple calls to
3838
ensure same distributions.
@@ -86,5 +86,5 @@ def plot_shifted_dataset(shift, random_state=42):
8686

8787
# %% Visualize shifted datasets
8888

89-
for shift in ["covariate_shift", "target_shift", "concept_drift", "subspace"]:
89+
for shift in ["covariate_shift", "target_shift", "conditional_shift", "subspace"]:
9090
plot_shifted_dataset(shift)

examples/methods/plot_jdot_da.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
======================================
44
55
This example shows how to use the JDOTRegressor [10] to learn a regression model
6-
from source to target domain on a simple concept drift 2D example. We use a
6+
from source to target domain on a simple conditional shift 2D example. We use a
77
simple Kernel Ridge Regression (KRR) as base estimator.
88
99
We compare the performance of the KRR on the source and target domain, and the
@@ -33,15 +33,15 @@
3333
from skada.datasets import make_shifted_datasets
3434

3535
# %%
36-
# Generate concept drift regression dataset and plot it
36+
# Generate conditional shift regression dataset and plot it
3737
# -----------------------------------------------------
3838
#
39-
# We generate a simple 2D concept drift dataset.
39+
# We generate a simple 2D conditional shift dataset.
4040

4141
X, y, sample_domain = make_shifted_datasets(
4242
n_samples_source=20,
4343
n_samples_target=20,
44-
shift="concept_drift",
44+
shift="conditional_shift",
4545
noise=0.3,
4646
label="regression",
4747
random_state=42,
@@ -170,15 +170,15 @@
170170

171171

172172
# %%
173-
# Generate concept drift classification dataset and plot it
173+
# Generate conditional shift classification dataset and plot it
174174
# -----------------------------------------------------
175175
#
176-
# We generate a simple 2D concept drift dataset.
176+
# We generate a simple 2D conditional shift dataset.
177177

178178
X, y, sample_domain = make_shifted_datasets(
179179
n_samples_source=20,
180180
n_samples_target=20,
181-
shift="concept_drift",
181+
shift="conditional_shift",
182182
noise=0.2,
183183
label="multiclass",
184184
random_state=42,

examples/methods/plot_label_prop_da.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
the target domain using the OT plan. This was proposed originally in [28]_ for
88
semi-supervised learning but can be used for DA.
99
10-
We illustrate the method on a simple regression and classification concept drift
10+
We illustrate the method on a simple regression and classification conditional shift
1111
dataset. We train a simple Kernel Ridge Regression (KRR) and Logistic Regression
1212
on the source domain and evaluate their performance on the source and target
1313
domain. We then train the same models with the label propagation method and
@@ -42,15 +42,15 @@
4242
from skada.datasets import make_shifted_datasets
4343

4444
# %%
45-
# Generate concept drift regression dataset and plot it
45+
# Generate conditional shift regression dataset and plot it
4646
# -----------------------------------------------------
4747
#
48-
# We generate a simple 2D concept drift dataset.
48+
# We generate a simple 2D conditional shift dataset.
4949

5050
X, y, sample_domain = make_shifted_datasets(
5151
n_samples_source=20,
5252
n_samples_target=20,
53-
shift="concept_drift",
53+
shift="conditional_shift",
5454
noise=0.3,
5555
label="regression",
5656
random_state=42,
@@ -177,15 +177,15 @@
177177

178178

179179
# %%
180-
# Generate concept drift classification dataset and plot it
180+
# Generate conditional shift classification dataset and plot it
181181
# -----------------------------------------------------
182182
#
183-
# We generate a simple 2D concept drift dataset.
183+
# We generate a simple 2D conditional shift dataset.
184184

185185
X, y, sample_domain = make_shifted_datasets(
186186
n_samples_source=20,
187187
n_samples_target=20,
188-
shift="concept_drift",
188+
shift="conditional_shift",
189189
noise=0.2,
190190
label="multiclass",
191191
random_state=42,

examples/methods/plot_monge_alignment_da.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
from skada.datasets import make_shifted_datasets
2525

2626
# %%
27-
# Generate concept drift classification dataset and plot it
27+
# Generate conditional shift classification dataset and plot it
2828
# -----------------------------------------------------
2929
#
30-
# We generate a simple 2D concept drift dataset.
30+
# We generate a simple 2D conditional shift dataset.
3131

3232
X, y, sample_domain = make_shifted_datasets(
3333
n_samples_source=20,
3434
n_samples_target=20,
35-
shift="concept_drift",
35+
shift="conditional_shift",
3636
noise=0.2,
3737
label="multiclass",
3838
random_state=42,
@@ -136,7 +136,7 @@ def get_multidomain_data(
136136
n_samples_source=n_samples_source,
137137
n_samples_target=n_samples_target,
138138
noise=noise,
139-
shift="concept_drift",
139+
shift="conditional_shift",
140140
label="multiclass",
141141
random_state=random_state,
142142
)
@@ -145,7 +145,7 @@ def get_multidomain_data(
145145
n_samples_source=n_samples_source,
146146
n_samples_target=n_samples_target,
147147
noise=noise,
148-
shift="concept_drift",
148+
shift="conditional_shift",
149149
label="multiclass",
150150
random_state=random_state + ns,
151151
mean=np.random.randn(2),
@@ -161,7 +161,7 @@ def get_multidomain_data(
161161
n_samples_source=n_samples_source,
162162
n_samples_target=n_samples_target,
163163
noise=noise,
164-
shift="concept_drift",
164+
shift="conditional_shift",
165165
label="multiclass",
166166
random_state=random_state + nt + 42,
167167
mean=np.random.randn(2),

examples/methods/plot_optimal_transport_da.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
from skada.datasets import make_shifted_datasets
3232

3333
# %%
34-
# Generate concept drift dataset
34+
# Generate conditional shift dataset
3535
# ------------------------------
3636
n_samples = 20
3737
X, y, sample_domain = make_shifted_datasets(
3838
n_samples_source=n_samples,
3939
n_samples_target=n_samples + 1,
40-
shift="concept_drift",
40+
shift="conditional_shift",
4141
noise=0.1,
4242
random_state=42,
4343
)

examples/plot_how_to_use_skada.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
# Get DA dataset
5252
X, y, sample_domain = make_shifted_datasets(
53-
20, 20, shift="concept_drift", random_state=42
53+
20, 20, shift="conditional_shift", random_state=42
5454
)
5555

5656
# split source and target for visualization
@@ -137,7 +137,7 @@
137137
print("Accuracy on target:", pipe.score(Xt, yt))
138138

139139
# create a DA pipeline with GaussianReweight adapter (does not work well on
140-
# concept drift).
140+
# conditional shift).
141141
pipe = make_da_pipeline(
142142
StandardScaler(),
143143
GaussianReweightAdapter(),

examples/plot_method_comparison.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
make_shifted_datasets(
115115
n_samples_source=20,
116116
n_samples_target=20,
117-
shift="concept_drift",
117+
shift="conditional_shift",
118118
label="binary",
119119
noise=0.4,
120120
random_state=RANDOM_SEED,

examples/validation/plot_cross_val_score_for_da.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
dataset = make_shifted_datasets(
2424
n_samples_source=30,
2525
n_samples_target=20,
26-
shift="concept_drift",
26+
shift="conditional_shift",
2727
label="binary",
2828
noise=0.4,
2929
random_state=RANDOM_SEED,

0 commit comments

Comments
 (0)