Skip to content

Commit 4080b06

Browse files
committed
Pushing the docs to dev/ for branch: master, commit b705cb811df5b3be582712cd9644743401ab1a43
1 parent 00bfa4e commit 4080b06

File tree

936 files changed

+2619
-2619
lines changed

Some content is hidden

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

936 files changed

+2619
-2619
lines changed
2 Bytes
Binary file not shown.
2 Bytes
Binary file not shown.

dev/_downloads/plot_sgd_loss_functions.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"execution_count": null,
2525
"cell_type": "code",
2626
"source": [
27-
"print(__doc__)\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef modified_huber_loss(y_true, y_pred):\n z = y_pred * y_true\n loss = -4 * z\n loss[z >= -1] = (1 - z[z >= -1]) ** 2\n loss[z >= 1.] = 0\n return loss\n\n\nxmin, xmax = -4, 4\nxx = np.linspace(xmin, xmax, 100)\nlw = 2\nplt.plot([xmin, 0, 0, xmax], [1, 1, 0, 0], color='gold', lw=lw,\n label=\"Zero-one loss\")\nplt.plot(xx, np.where(xx < 1, 1 - xx, 0), color='teal', lw=lw,\n label=\"Hinge loss\")\nplt.plot(xx, -np.minimum(xx, 0), color='yellowgreen', lw=lw,\n label=\"Perceptron loss\")\nplt.plot(xx, np.log2(1 + np.exp(-xx)), color='cornflowerblue', lw=lw,\n label=\"Log loss\")\nplt.plot(xx, np.where(xx < 1, 1 - xx, 0) ** 2, color='orange', lw=lw,\n label=\"Squared hinge loss\")\nplt.plot(xx, modified_huber_loss(xx, 1), color='darkorchid', lw=lw,\n linestyle='--', label=\"Modified Huber loss\")\nplt.ylim((0, 8))\nplt.legend(loc=\"upper right\")\nplt.xlabel(r\"Decision function $f(x)$\")\nplt.ylabel(\"$L(y, f(x))$\")\nplt.show()"
27+
"print(__doc__)\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef modified_huber_loss(y_true, y_pred):\n z = y_pred * y_true\n loss = -4 * z\n loss[z >= -1] = (1 - z[z >= -1]) ** 2\n loss[z >= 1.] = 0\n return loss\n\n\nxmin, xmax = -4, 4\nxx = np.linspace(xmin, xmax, 100)\nlw = 2\nplt.plot([xmin, 0, 0, xmax], [1, 1, 0, 0], color='gold', lw=lw,\n label=\"Zero-one loss\")\nplt.plot(xx, np.where(xx < 1, 1 - xx, 0), color='teal', lw=lw,\n label=\"Hinge loss\")\nplt.plot(xx, -np.minimum(xx, 0), color='yellowgreen', lw=lw,\n label=\"Perceptron loss\")\nplt.plot(xx, np.log2(1 + np.exp(-xx)), color='cornflowerblue', lw=lw,\n label=\"Log loss\")\nplt.plot(xx, np.where(xx < 1, 1 - xx, 0) ** 2, color='orange', lw=lw,\n label=\"Squared hinge loss\")\nplt.plot(xx, modified_huber_loss(xx, 1), color='darkorchid', lw=lw,\n linestyle='--', label=\"Modified Huber loss\")\nplt.ylim((0, 8))\nplt.legend(loc=\"upper right\")\nplt.xlabel(r\"Decision function $f(x)$\")\nplt.ylabel(\"$L(y=1, f(x))$\")\nplt.show()"
2828
],
2929
"outputs": [],
3030
"metadata": {

dev/_downloads/plot_sgd_loss_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ def modified_huber_loss(y_true, y_pred):
3838
plt.ylim((0, 8))
3939
plt.legend(loc="upper right")
4040
plt.xlabel(r"Decision function $f(x)$")
41-
plt.ylabel("$L(y, f(x))$")
41+
plt.ylabel("$L(y=1, f(x))$")
4242
plt.show()

dev/_downloads/scikit-learn-docs.pdf

-6.45 KB
Binary file not shown.
37 Bytes
37 Bytes
-47 Bytes
-47 Bytes
33 Bytes

0 commit comments

Comments
 (0)