Skip to content

Commit 689dd94

Browse files
committed
Pushing the docs to dev/ for branch: main, commit b0f86e797190d1fd62331eac8b88a5b0dfa522b9
1 parent b52fe32 commit 689dd94

File tree

1,264 files changed

+6123
-6178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,264 files changed

+6123
-6178
lines changed
Binary file not shown.

dev/_downloads/10754505339af88c10b8a48127535a4a/plot_quantile_regression.ipynb

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,7 @@
8787
},
8888
"outputs": [],
8989
"source": [
90-
"from sklearn.utils.fixes import parse_version, sp_version\n\n# This is line is to avoid incompatibility if older SciPy version.\n# You should use `solver=\"highs\"` with recent version of SciPy.\nsolver = \"highs\" if sp_version >= parse_version(\"1.6.0\") else \"interior-point\""
91-
]
92-
},
93-
{
94-
"cell_type": "code",
95-
"execution_count": null,
96-
"metadata": {
97-
"collapsed": false
98-
},
99-
"outputs": [],
100-
"source": [
101-
"from sklearn.linear_model import QuantileRegressor\n\nquantiles = [0.05, 0.5, 0.95]\npredictions = {}\nout_bounds_predictions = np.zeros_like(y_true_mean, dtype=np.bool_)\nfor quantile in quantiles:\n qr = QuantileRegressor(quantile=quantile, alpha=0, solver=solver)\n y_pred = qr.fit(X, y_normal).predict(X)\n predictions[quantile] = y_pred\n\n if quantile == min(quantiles):\n out_bounds_predictions = np.logical_or(\n out_bounds_predictions, y_pred >= y_normal\n )\n elif quantile == max(quantiles):\n out_bounds_predictions = np.logical_or(\n out_bounds_predictions, y_pred <= y_normal\n )"
90+
"from sklearn.linear_model import QuantileRegressor\n\nquantiles = [0.05, 0.5, 0.95]\npredictions = {}\nout_bounds_predictions = np.zeros_like(y_true_mean, dtype=np.bool_)\nfor quantile in quantiles:\n qr = QuantileRegressor(quantile=quantile, alpha=0)\n y_pred = qr.fit(X, y_normal).predict(X)\n predictions[quantile] = y_pred\n\n if quantile == min(quantiles):\n out_bounds_predictions = np.logical_or(\n out_bounds_predictions, y_pred >= y_normal\n )\n elif quantile == max(quantiles):\n out_bounds_predictions = np.logical_or(\n out_bounds_predictions, y_pred <= y_normal\n )"
10291
]
10392
},
10493
{
@@ -134,7 +123,7 @@
134123
},
135124
"outputs": [],
136125
"source": [
137-
"quantiles = [0.05, 0.5, 0.95]\npredictions = {}\nout_bounds_predictions = np.zeros_like(y_true_mean, dtype=np.bool_)\nfor quantile in quantiles:\n qr = QuantileRegressor(quantile=quantile, alpha=0, solver=solver)\n y_pred = qr.fit(X, y_pareto).predict(X)\n predictions[quantile] = y_pred\n\n if quantile == min(quantiles):\n out_bounds_predictions = np.logical_or(\n out_bounds_predictions, y_pred >= y_pareto\n )\n elif quantile == max(quantiles):\n out_bounds_predictions = np.logical_or(\n out_bounds_predictions, y_pred <= y_pareto\n )"
126+
"quantiles = [0.05, 0.5, 0.95]\npredictions = {}\nout_bounds_predictions = np.zeros_like(y_true_mean, dtype=np.bool_)\nfor quantile in quantiles:\n qr = QuantileRegressor(quantile=quantile, alpha=0)\n y_pred = qr.fit(X, y_pareto).predict(X)\n predictions[quantile] = y_pred\n\n if quantile == min(quantiles):\n out_bounds_predictions = np.logical_or(\n out_bounds_predictions, y_pred >= y_pareto\n )\n elif quantile == max(quantiles):\n out_bounds_predictions = np.logical_or(\n out_bounds_predictions, y_pred <= y_pareto\n )"
138127
]
139128
},
140129
{
@@ -163,7 +152,7 @@
163152
},
164153
"outputs": [],
165154
"source": [
166-
"from sklearn.linear_model import LinearRegression\nfrom sklearn.metrics import mean_absolute_error, mean_squared_error\n\nlinear_regression = LinearRegression()\nquantile_regression = QuantileRegressor(quantile=0.5, alpha=0, solver=solver)\n\ny_pred_lr = linear_regression.fit(X, y_pareto).predict(X)\ny_pred_qr = quantile_regression.fit(X, y_pareto).predict(X)\n\nprint(\n f\"\"\"Training error (in-sample performance)\n {linear_regression.__class__.__name__}:\n MAE = {mean_absolute_error(y_pareto, y_pred_lr):.3f}\n MSE = {mean_squared_error(y_pareto, y_pred_lr):.3f}\n {quantile_regression.__class__.__name__}:\n MAE = {mean_absolute_error(y_pareto, y_pred_qr):.3f}\n MSE = {mean_squared_error(y_pareto, y_pred_qr):.3f}\n \"\"\"\n)"
155+
"from sklearn.linear_model import LinearRegression\nfrom sklearn.metrics import mean_absolute_error, mean_squared_error\n\nlinear_regression = LinearRegression()\nquantile_regression = QuantileRegressor(quantile=0.5, alpha=0)\n\ny_pred_lr = linear_regression.fit(X, y_pareto).predict(X)\ny_pred_qr = quantile_regression.fit(X, y_pareto).predict(X)\n\nprint(\n f\"\"\"Training error (in-sample performance)\n {linear_regression.__class__.__name__}:\n MAE = {mean_absolute_error(y_pareto, y_pred_lr):.3f}\n MSE = {mean_squared_error(y_pareto, y_pred_lr):.3f}\n {quantile_regression.__class__.__name__}:\n MAE = {mean_absolute_error(y_pareto, y_pred_qr):.3f}\n MSE = {mean_squared_error(y_pareto, y_pred_qr):.3f}\n \"\"\"\n)"
167156
]
168157
},
169158
{
Binary file not shown.

dev/_downloads/8a712694e4d011e8f35bfcb1b1b5fc82/plot_quantile_regression.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,6 @@
109109
#
110110
# We will use the quantiles at 5% and 95% to find the outliers in the training
111111
# sample beyond the central 90% interval.
112-
from sklearn.utils.fixes import parse_version, sp_version
113-
114-
# This is line is to avoid incompatibility if older SciPy version.
115-
# You should use `solver="highs"` with recent version of SciPy.
116-
solver = "highs" if sp_version >= parse_version("1.6.0") else "interior-point"
117112

118113
# %%
119114
from sklearn.linear_model import QuantileRegressor
@@ -122,7 +117,7 @@
122117
predictions = {}
123118
out_bounds_predictions = np.zeros_like(y_true_mean, dtype=np.bool_)
124119
for quantile in quantiles:
125-
qr = QuantileRegressor(quantile=quantile, alpha=0, solver=solver)
120+
qr = QuantileRegressor(quantile=quantile, alpha=0)
126121
y_pred = qr.fit(X, y_normal).predict(X)
127122
predictions[quantile] = y_pred
128123

@@ -184,7 +179,7 @@
184179
predictions = {}
185180
out_bounds_predictions = np.zeros_like(y_true_mean, dtype=np.bool_)
186181
for quantile in quantiles:
187-
qr = QuantileRegressor(quantile=quantile, alpha=0, solver=solver)
182+
qr = QuantileRegressor(quantile=quantile, alpha=0)
188183
y_pred = qr.fit(X, y_pareto).predict(X)
189184
predictions[quantile] = y_pred
190185

@@ -254,7 +249,7 @@
254249
from sklearn.metrics import mean_absolute_error, mean_squared_error
255250

256251
linear_regression = LinearRegression()
257-
quantile_regression = QuantileRegressor(quantile=0.5, alpha=0, solver=solver)
252+
quantile_regression = QuantileRegressor(quantile=0.5, alpha=0)
258253

259254
y_pred_lr = linear_regression.fit(X, y_pareto).predict(X)
260255
y_pred_qr = quantile_regression.fit(X, y_pareto).predict(X)

dev/_downloads/scikit-learn-docs.zip

-3.34 KB
Binary file not shown.
-141 Bytes
109 Bytes
7 Bytes
205 Bytes
-152 Bytes
-60 Bytes
-64 Bytes
-124 Bytes
2.07 KB
7.35 KB
75 Bytes
-22 Bytes
9 Bytes
69 Bytes
-58 Bytes
77 Bytes
128 Bytes
-69 Bytes
-23 Bytes
-235 Bytes
-223 Bytes
20 Bytes
-2 Bytes
-59 Bytes
162 Bytes
-534 Bytes
-174 Bytes
-154 Bytes
370 Bytes
-88 Bytes
29 Bytes
-47 Bytes
-28 Bytes
-7 Bytes

dev/_sources/auto_examples/applications/plot_cyclical_feature_engineering.rst.txt

Lines changed: 1 addition & 1 deletion

dev/_sources/auto_examples/applications/plot_digits_denoising.rst.txt

Lines changed: 1 addition & 1 deletion

dev/_sources/auto_examples/applications/plot_face_recognition.rst.txt

Lines changed: 4 additions & 4 deletions

dev/_sources/auto_examples/applications/plot_model_complexity_influence.rst.txt

Lines changed: 15 additions & 15 deletions

0 commit comments

Comments
 (0)