Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ddbe557

Browse filesBrowse files
authored
MNT make plot_partial_dependence faster (#25806)
1 parent 5ffec32 commit ddbe557
Copy full SHA for ddbe557

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed

‎examples/inspection/plot_partial_dependence.py

Copy file name to clipboardExpand all lines: examples/inspection/plot_partial_dependence.py
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
# Make an explicit copy to avoid "SettingWithCopyWarning" from pandas
4747
X, y = bikes.data.copy(), bikes.target
4848

49+
# We use only a subset of the data to speed up the example.
50+
X = X.iloc[::5, :]
51+
y = y[::5]
52+
4953
# %%
5054
# The feature `"weather"` has a particularity: the category `"heavy_rain"` is a rare
5155
# category.
@@ -286,7 +290,9 @@
286290
hgbdt_model = make_pipeline(
287291
hgbdt_preprocessor,
288292
HistGradientBoostingRegressor(
289-
categorical_features=categorical_features, random_state=0
293+
categorical_features=categorical_features,
294+
random_state=0,
295+
max_iter=50,
290296
),
291297
)
292298
hgbdt_model.fit(X_train, y_train)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.