Skip to content

Commit 3fdf6ed

Browse files
DOC: make an image generation deterministic, to avoid it changing each time we build the doc
1 parent 89f55a3 commit 3fdf6ed

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/regression/1-quickstart/plot_toy_model.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
from mapie.metrics import regression_coverage_score
1414
from mapie.regression import MapieRegressor
1515

16+
RANDOM_STATE = 42
1617
regressor = LinearRegression()
17-
X, y = make_regression(n_samples=500, n_features=1, noise=20, random_state=59)
18+
X, y = make_regression(
19+
n_samples=500, n_features=1, noise=20, random_state=RANDOM_STATE
20+
)
1821

1922
alpha = [0.05, 0.32]
20-
mapie = MapieRegressor(regressor, method="plus")
23+
mapie = MapieRegressor(regressor, method="plus", random_state=RANDOM_STATE)
2124
mapie.fit(X, y)
2225
y_pred, y_pis = mapie.predict(X, alpha=alpha)
2326

0 commit comments

Comments
 (0)