Skip to content

Commit 12e71f3

Browse files
committed
FIX: sections titles in tutorial
1 parent f937bc8 commit 12e71f3

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

examples/mondrian/1-quickstart/plot_main-tutorial-mondrian-regression.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@
3535

3636

3737
##############################################################################
38-
# 1. Create the noisy dataset with 10 groups, each of those groups having
39-
# a different level of noise.
40-
# -------------------------------------------------------------------
38+
# 1. Create the noisy dataset
39+
# -----------------------------
40+
# We create a dataset with 10 groups, each of those groups having a different
41+
# level of noise.
4142

4243

4344
n_points = 100000
@@ -86,7 +87,7 @@
8687

8788
##############################################################################
8889
# 2. Split the dataset into a training set, a calibration set, and a test set.
89-
90+
# -----------------------------
9091

9192
X_train_temp, X_test, y_train_temp, y_test = train_test_split(
9293
X, y, test_size=0.2, random_state=0
@@ -118,15 +119,15 @@
118119

119120
##############################################################################
120121
# 3. Fit a random forest regressor on the training set.
121-
122+
# -----------------------------
122123

123124
rf = RandomForestRegressor(n_estimators=100)
124125
rf.fit(X_train, y_train)
125126

126127

127128
##############################################################################
128129
# 4. Fit a MapieRegressor and a MondrianCP on the calibration set.
129-
130+
# -----------------------------
130131

131132
mapie_regressor = MapieRegressor(rf, cv="prefit")
132133
mondrian_regressor = MondrianCP(MapieRegressor(rf, cv="prefit"))
@@ -136,7 +137,7 @@
136137

137138
##############################################################################
138139
# 5. Predict the prediction intervals on the test set with both methods.
139-
140+
# -----------------------------
140141

141142
_, y_pss_split = mapie_regressor.predict(X_test, alpha=.1)
142143
_, y_pss_mondrian = mondrian_regressor.predict(
@@ -146,7 +147,7 @@
146147

147148
##############################################################################
148149
# 6. Compare the coverage by partition, plot both methods side by side.
149-
150+
# -----------------------------
150151

151152
coverages = {}
152153
for group in np.unique(partition_test):

0 commit comments

Comments
 (0)