Skip to content

Commit 11dc50f

Browse files
committed
Pushing the docs to dev/ for branch: master, commit e443c05ea3a4c2634611253759ddbeb4367fe70c
1 parent a327bdd commit 11dc50f

File tree

958 files changed

+2909
-2907
lines changed

Some content is hidden

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

958 files changed

+2909
-2907
lines changed
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

dev/_downloads/plot_label_propagation_structure.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\n# Authors: Clay Woolam <[email protected]>\n# Andreas Mueller <[email protected]>\n# License: BSD\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.semi_supervised import label_propagation\nfrom sklearn.datasets import make_circles\n\n# generate ring with inner box\nn_samples = 200\nX, y = make_circles(n_samples=n_samples, shuffle=False)\nouter, inner = 0, 1\nlabels = -np.ones(n_samples)\nlabels[0] = outer\nlabels[-1] = inner\n\n# #############################################################################\n# Learn with LabelSpreading\nlabel_spread = label_propagation.LabelSpreading(kernel='knn', alpha=0.2)\nlabel_spread.fit(X, labels)\n\n# #############################################################################\n# Plot output labels\noutput_labels = label_spread.transduction_\nplt.figure(figsize=(8.5, 4))\nplt.subplot(1, 2, 1)\nplt.scatter(X[labels == outer, 0], X[labels == outer, 1], color='navy',\n marker='s', lw=0, label=\"outer labeled\", s=10)\nplt.scatter(X[labels == inner, 0], X[labels == inner, 1], color='c',\n marker='s', lw=0, label='inner labeled', s=10)\nplt.scatter(X[labels == -1, 0], X[labels == -1, 1], color='darkorange',\n marker='.', label='unlabeled')\nplt.legend(scatterpoints=1, shadow=False, loc='upper right')\nplt.title(\"Raw data (2 classes=outer and inner)\")\n\nplt.subplot(1, 2, 2)\noutput_label_array = np.asarray(output_labels)\nouter_numbers = np.where(output_label_array == outer)[0]\ninner_numbers = np.where(output_label_array == inner)[0]\nplt.scatter(X[outer_numbers, 0], X[outer_numbers, 1], color='navy',\n marker='s', lw=0, s=10, label=\"outer learned\")\nplt.scatter(X[inner_numbers, 0], X[inner_numbers, 1], color='c',\n marker='s', lw=0, s=10, label=\"inner learned\")\nplt.legend(scatterpoints=1, shadow=False, loc='upper right')\nplt.title(\"Labels learned with Label Spreading (KNN)\")\n\nplt.subplots_adjust(left=0.07, bottom=0.07, right=0.93, top=0.92)\nplt.show()"
29+
"print(__doc__)\n\n# Authors: Clay Woolam <[email protected]>\n# Andreas Mueller <[email protected]>\n# License: BSD\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.semi_supervised import label_propagation\nfrom sklearn.datasets import make_circles\n\n# generate ring with inner box\nn_samples = 200\nX, y = make_circles(n_samples=n_samples, shuffle=False)\nouter, inner = 0, 1\nlabels = -np.ones(n_samples)\nlabels[0] = outer\nlabels[-1] = inner\n\n# #############################################################################\n# Learn with LabelSpreading\nlabel_spread = label_propagation.LabelSpreading(kernel='knn', alpha=0.8)\nlabel_spread.fit(X, labels)\n\n# #############################################################################\n# Plot output labels\noutput_labels = label_spread.transduction_\nplt.figure(figsize=(8.5, 4))\nplt.subplot(1, 2, 1)\nplt.scatter(X[labels == outer, 0], X[labels == outer, 1], color='navy',\n marker='s', lw=0, label=\"outer labeled\", s=10)\nplt.scatter(X[labels == inner, 0], X[labels == inner, 1], color='c',\n marker='s', lw=0, label='inner labeled', s=10)\nplt.scatter(X[labels == -1, 0], X[labels == -1, 1], color='darkorange',\n marker='.', label='unlabeled')\nplt.legend(scatterpoints=1, shadow=False, loc='upper right')\nplt.title(\"Raw data (2 classes=outer and inner)\")\n\nplt.subplot(1, 2, 2)\noutput_label_array = np.asarray(output_labels)\nouter_numbers = np.where(output_label_array == outer)[0]\ninner_numbers = np.where(output_label_array == inner)[0]\nplt.scatter(X[outer_numbers, 0], X[outer_numbers, 1], color='navy',\n marker='s', lw=0, s=10, label=\"outer learned\")\nplt.scatter(X[inner_numbers, 0], X[inner_numbers, 1], color='c',\n marker='s', lw=0, s=10, label=\"inner learned\")\nplt.legend(scatterpoints=1, shadow=False, loc='upper right')\nplt.title(\"Labels learned with Label Spreading (KNN)\")\n\nplt.subplots_adjust(left=0.07, bottom=0.07, right=0.93, top=0.92)\nplt.show()"
3030
]
3131
}
3232
],

dev/_downloads/plot_label_propagation_structure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
# #############################################################################
3232
# Learn with LabelSpreading
33-
label_spread = label_propagation.LabelSpreading(kernel='knn', alpha=0.2)
33+
label_spread = label_propagation.LabelSpreading(kernel='knn', alpha=0.8)
3434
label_spread.fit(X, labels)
3535

3636
# #############################################################################

dev/_downloads/scikit-learn-docs.pdf

9.87 KB
Binary file not shown.

0 commit comments

Comments
 (0)