Skip to content

Commit d100ac3

Browse files
committed
Pushing the docs to dev/ for branch: master, commit 943239592e7c65254eec8956eb38fe04fe116723
1 parent 4aea960 commit d100ac3

File tree

1,065 files changed

+3314
-3323
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,065 files changed

+3314
-3323
lines changed
-116 Bytes
Binary file not shown.
-113 Bytes
Binary file not shown.

dev/_downloads/plot_svm_regression.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"outputs": [],
2828
"source": [
29-
"print(__doc__)\n\nimport numpy as np\nfrom sklearn.svm import SVR\nimport matplotlib.pyplot as plt\n\n# #############################################################################\n# Generate sample data\nX = np.sort(5 * np.random.rand(40, 1), axis=0)\ny = np.sin(X).ravel()\n\n# #############################################################################\n# Add noise to targets\ny[::5] += 3 * (0.5 - np.random.rand(8))\n\n# #############################################################################\n# Fit regression model\nsvr_rbf = SVR(kernel='rbf', C=100, gamma=0.1, epsilon=.1)\nsvr_lin = SVR(kernel='linear', C=100, gamma='auto')\nsvr_poly = SVR(kernel='poly', C=100, gamma='auto', degree=3, epsilon=.1,\n coef0=1)\ny_rbf = svr_rbf.fit(X, y).predict(X)\ny_lin = svr_lin.fit(X, y).predict(X)\ny_poly = svr_poly.fit(X, y).predict(X)\n\n# #############################################################################\n# Look at the results\nlw = 2\n\nsvrs = [svr_rbf, svr_lin, svr_poly]\nkernel_label = ['RBF', 'Linear', 'Polynomial']\nmodel_color = ['m', 'c', 'g']\n\nfig, axes = plt.subplots(nrows=1, ncols=3, figsize=(15, 10), sharey=True)\nfor ix, svr in enumerate(svrs):\n axes[ix].plot(X, svr.fit(X, y).predict(X), color=model_color[ix], lw=lw,\n label='{} model'.format(kernel_label[ix]))\n axes[ix].scatter(X[svr.support_], y[svr.support_], facecolor=\"none\",\n edgecolor=model_color[ix], s=50,\n label='{} support vectors'.format(kernel_label[ix]))\n axes[ix].scatter(X[np.setdiff1d(np.arange(len(X)), svr.support_)],\n y[np.setdiff1d(np.arange(len(X)), svr.support_)],\n facecolor=\"none\", edgecolor=\"k\", s=50,\n label='other training data')\n axes[ix].legend(loc='upper center', bbox_to_anchor=(0.5, 1.1),\n ncol=1, fancybox=True, shadow=True)\n\nfig.text(0.5, 0.04, 'data', ha='center', va='center')\nfig.text(0.06, 0.5, 'target', ha='center', va='center', rotation='vertical')\nfig.suptitle(\"Support Vector Regression\", fontsize=14)\nplt.show()"
29+
"print(__doc__)\n\nimport numpy as np\nfrom sklearn.svm import SVR\nimport matplotlib.pyplot as plt\n\n# #############################################################################\n# Generate sample data\nX = np.sort(5 * np.random.rand(40, 1), axis=0)\ny = np.sin(X).ravel()\n\n# #############################################################################\n# Add noise to targets\ny[::5] += 3 * (0.5 - np.random.rand(8))\n\n# #############################################################################\n# Fit regression model\nsvr_rbf = SVR(kernel='rbf', C=100, gamma=0.1, epsilon=.1)\nsvr_lin = SVR(kernel='linear', C=100, gamma='auto')\nsvr_poly = SVR(kernel='poly', C=100, gamma='auto', degree=3, epsilon=.1,\n coef0=1)\n\n# #############################################################################\n# Look at the results\nlw = 2\n\nsvrs = [svr_rbf, svr_lin, svr_poly]\nkernel_label = ['RBF', 'Linear', 'Polynomial']\nmodel_color = ['m', 'c', 'g']\n\nfig, axes = plt.subplots(nrows=1, ncols=3, figsize=(15, 10), sharey=True)\nfor ix, svr in enumerate(svrs):\n axes[ix].plot(X, svr.fit(X, y).predict(X), color=model_color[ix], lw=lw,\n label='{} model'.format(kernel_label[ix]))\n axes[ix].scatter(X[svr.support_], y[svr.support_], facecolor=\"none\",\n edgecolor=model_color[ix], s=50,\n label='{} support vectors'.format(kernel_label[ix]))\n axes[ix].scatter(X[np.setdiff1d(np.arange(len(X)), svr.support_)],\n y[np.setdiff1d(np.arange(len(X)), svr.support_)],\n facecolor=\"none\", edgecolor=\"k\", s=50,\n label='other training data')\n axes[ix].legend(loc='upper center', bbox_to_anchor=(0.5, 1.1),\n ncol=1, fancybox=True, shadow=True)\n\nfig.text(0.5, 0.04, 'data', ha='center', va='center')\nfig.text(0.06, 0.5, 'target', ha='center', va='center', rotation='vertical')\nfig.suptitle(\"Support Vector Regression\", fontsize=14)\nplt.show()"
3030
]
3131
}
3232
],

dev/_downloads/plot_svm_regression.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
svr_lin = SVR(kernel='linear', C=100, gamma='auto')
2828
svr_poly = SVR(kernel='poly', C=100, gamma='auto', degree=3, epsilon=.1,
2929
coef0=1)
30-
y_rbf = svr_rbf.fit(X, y).predict(X)
31-
y_lin = svr_lin.fit(X, y).predict(X)
32-
y_poly = svr_poly.fit(X, y).predict(X)
3330

3431
# #############################################################################
3532
# Look at the results

dev/_downloads/scikit-learn-docs.pdf

-1.47 KB
Binary file not shown.

dev/_images/iris.png

0 Bytes
-290 Bytes
-290 Bytes
-528 Bytes
-528 Bytes

0 commit comments

Comments
 (0)