Skip to content

DOC [PST] FIX/RFC machine learning map #28630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ repos:
hooks:
- id: prettier
files: ^doc/scss/|^doc/js/scripts/
exclude: ^doc/js/scripts/vendor/
types_or: ["scss", "javascript"]
Binary file removed doc/images/ml_map.png
Binary file not shown.
4 changes: 4 additions & 0 deletions doc/images/ml_map.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions doc/js/scripts/vendor/svg-pan-zoom.min.js

Large diffs are not rendered by default.

93 changes: 0 additions & 93 deletions doc/tutorial/machine_learning_map/ML_MAPS_README.txt

This file was deleted.

17 changes: 17 additions & 0 deletions doc/tutorial/machine_learning_map/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
The scikit-learn machine learning cheat sheet was originally created by Andreas Mueller:
https://peekaboo-vision.blogspot.de/2013/01/machine-learning-cheat-sheet-for-scikit.html

The current version of the chart is located at `doc/images/ml_map.svg` in SVG+XML
format, created using [draw.io](https://draw.io/). To edit the chart, open the file in
draw.io, make changes, and export as SVG with the same filename. Export configurations
are:

- Zoom: 100%
- Border width: 15
- Size: Diagram
- Transparent Background: False
- Appearance: Light

Each node in the chart that contains an estimator should have a link, where the root
directory is at `../../`. Note that after exporting the SVG, the links may be prefixed
with e.g. `https://app.diagrams.net/`. Remember to check and remove them.
101 changes: 62 additions & 39 deletions doc/tutorial/machine_learning_map/index.rst
Original file line number Diff line number Diff line change
@@ -1,52 +1,75 @@
:html_theme.sidebar_secondary.remove:

.. _ml_map:

Choosing the right estimator
=======================================================
============================

Often the hardest part of solving a machine learning problem can be finding the right
estimator for the job. Different estimators are better suited for different types of
data and different problems.

The flowchart below is designed to give users a bit of a rough guide on how to approach
problems with regard to which estimators to try on your data. Click on any estimator in
the chart below to see its documentation. Use scroll wheel to zoom in and out, and click
and drag to pan around. You can also download the chart:
:download:`ml_map.svg <../../images/ml_map.svg>`.

.. raw:: html

<style>
#sk-ml-map {
height: 80vh;
margin: 1.5rem 0;
}

#sk-ml-map svg {
height: 100%;
width: 100%;
border: 2px solid var(--pst-color-border);
border-radius: 0.5rem;
}

Often the hardest part of solving a machine learning problem can
be finding the right estimator for the job.
html[data-theme="dark"] #sk-ml-map svg {
filter: invert(90%) hue-rotate(180deg);
}
</style>

Different estimators are better suited for different types of data
and different problems.
<script src="../../_static/scripts/vendor/svg-pan-zoom.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
const beforePan = function (oldPan, newPan) {
const gutterWidth = 100, gutterHeight = 100;
const sizes = this.getSizes();

The flowchart below is designed to give users a bit of
a rough guide on how to approach problems with regard to
which estimators to try on your data.
// Compute pan limits
const leftLimit = -((sizes.viewBox.x + sizes.viewBox.width) * sizes.realZoom) + gutterWidth;
const rightLimit = sizes.width - gutterWidth - (sizes.viewBox.x * sizes.realZoom);
const topLimit = -((sizes.viewBox.y + sizes.viewBox.height) * sizes.realZoom) + gutterHeight;
const bottomLimit = sizes.height - gutterHeight - (sizes.viewBox.y * sizes.realZoom);

Click on any estimator in the chart below to see its documentation.
return {
x: Math.max(leftLimit, Math.min(rightLimit, newPan.x)),
y: Math.max(topLimit, Math.min(bottomLimit, newPan.y))
};
};

// Limit the pan
svgPanZoom("#sk-ml-map svg", {
zoomEnabled: true,
controlIconsEnabled: true,
fit: 1,
center: 1,
beforePan: beforePan,
});
});
</script>

<div id="sk-ml-map">

.. raw:: html
:file: ../../images/ml_map.svg

.. raw:: html

<img src="../../_static/ml_map.png" class="map" alt="Move mouse over image" usemap="#imgmap">
<map name="imgmap">
<area href="../../documentation.html" title="Back to Documentation" shape="poly" coords="97,1094, 76,1097, 56,1105, 40,1120, 35,1132, 34,1145, 35,1153, 40,1162, 46,1171, 54,1177, 62,1182, 72,1187, 81,1188, 100,1189, 118,1186, 127,1182, 136,1177, 146,1170, 152,1162, 155,1158, 158,1146, 158,1126, 143,1110, 138,1105, 127,1100, 97,1094"></area>
<area href="../../modules/linear_model.html#elastic-net" title="Elastic Net Documentation" shape="poly" coords="1556,446, 1556,446, 1556,476, 1556,476, 1556,476, 1676,476, 1676,476, 1676,476, 1676,446, 1676,446, 1676,446, 1556,446, 1556,446" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/ensemble.html" title="Ensemble Methods Documentation" shape="poly" coords="209,200, 209,200, 209,252, 209,252, 209,252, 332,252, 332,252, 332,252, 332,200, 332,200, 332,200, 209,200, 209,200" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/ensemble.html" title="Ensemble Methods Documentation" shape="poly" coords="1828,506, 1828,506, 1828,544, 1828,544, 1828,544, 2054,544, 2054,544, 2054,544, 2054,506, 2054,506, 2054,506, 1828,506, 1828,506" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/mixture.html" title="Gaussian mixture models Documentation" shape="poly" coords="142,637, 142,637, 142,667, 142,667, 142,667, 265,667, 265,667, 265,667, 265,637, 265,637, 265,637, 142,637, 142,637" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/manifold.html#isomap" title="Isomap Documentation" shape="poly" coords="1500,799, 1500,799, 1500,844, 1500,844, 1500,844, 1618,844, 1618,844, 1618,844, 1618,800, 1618,800, 1618,800, 1500,799, 1500,799" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/kernel_approximation.html" title="Kernel Approximation Documentation" shape="poly" coords="1477,982, 1477,982, 1477,1055, 1477,1055, 1477,1055, 1638,1055, 1638,1055, 1638,1055, 1638,982, 1638,982, 1638,982, 1477,982, 1477,982" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/kernel_approximation.html" title="Kernel Approximation Documentation" shape="poly" coords="472,100, 472,100, 472,173, 472,173, 472,173, 634,173, 634,173, 634,173, 634,100, 634,100, 634,100, 472,100, 472,100" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/clustering.html#k-means" title="KMeans Documentation" shape="poly" coords="377,605, 377,605, 377,655, 377,655, 377,655, 476,655, 476,655, 476,655, 476,605, 476,605, 476,605, 377,605, 377,605" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/neighbors.html" title="Nearest Neighbors" shape="poly" coords="440,219, 440,219, 440,293, 440,293, 440,293, 574,293, 574,293, 574,293, 574,219, 574,219, 574,219, 440,219, 440,219" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/linear_model.html#lasso" title="Lasso Documentation" shape="poly" coords="1550,408, 1550,408, 1550,436, 1550,436, 1550,436, 1671,436, 1671,436, 1671,436, 1671,408, 1671,408, 1671,408, 1550,408, 1550,408" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/svm.html#classification" title="LinearSVC Documentation" shape="poly" coords="609,419, 609,419, 609,492, 609,492, 609,492, 693,492, 693,492, 693,492, 693,419, 693,419, 693,419, 609,419, 609,419" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/manifold.html#locally-linear-embedding" title="Locally Linear Embedding Documentation" shape="poly" coords="1719,888, 1719,888, 1719,945, 1719,945, 1719,945, 1819,945, 1819,945, 1819,945, 1819,888, 1819,888, 1819,888, 1719,888, 1719,888" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/clustering.html#mean-shift" title="Mean Shift Documentation" shape="poly" coords="562,949, 562,949, 562,981, 562,981, 562,981, 682,981, 682,981, 682,981, 682,949, 682,949, 682,949, 562,949, 562,949" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/clustering.html#mini-batch-k-means" title="Mini Batch K-means Documentation" shape="poly" coords="343,917, 343,917, 343,990, 343,990, 343,990, 461,990, 461,990, 461,990, 461,917, 461,917, 461,917, 343,917, 343,917" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/naive_bayes.html" title="Naive Bayes Documentation" shape="poly" coords="194,339, 194,339, 194,412, 194,412, 194,412, 294,412, 294,412, 294,412, 294,339, 294,339, 294,339, 194,339, 194,339" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/decomposition.html#principal-component-analysis-pca" title="Principal Component Analysis Documentation" shape="poly" coords="1208,778, 1208,778, 1208,851, 1208,851, 1208,851, 1350,851, 1350,851, 1350,851, 1350,778, 1350,778, 1350,778, 1208,778, 1208,778" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/linear_model.html#ridge-regression" title="Ridge Regression Documentation" shape="poly" coords="1696,648, 1696,648, 1696,687, 1696,687, 1696,687, 1890,687, 1890,687, 1890,687, 1890,648, 1890,648, 1890,648, 1696,648, 1696,648" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/sgd.html#classification" title="SGD Classifier Documentation" shape="poly" coords="691,205, 691,205, 691,278, 691,278, 691,278, 803,278, 803,278, 803,278, 803,205, 803,205, 803,205, 691,205, 691,205" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/sgd.html#regression" title="SGD Regression Documentation" shape="poly" coords="1317,425, 1317,425, 1317,498, 1317,498, 1317,498, 1436,498, 1436,498, 1436,498, 1436,425, 1436,425, 1436,425, 1317,425, 1317,425" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/clustering.html#spectral-clustering" title="Spectral Clustering Documentation" shape="poly" coords="145,572, 145,572, 145,631, 145,631, 145,631, 267,631, 267,631, 267,631, 267,572, 267,572, 267,572, 145,572, 145,572" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/manifold.html#spectral-embedding" title="Spectral Embedding Documentation" shape="poly" coords="1502,849, 1502,849, 1502,910, 1502,910, 1502,910, 1618,910, 1618,910, 1618,910, 1618,849, 1618,849, 1618,849, 1502,849, 1502,849" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/svm.html#classification" title="SVC Documentation" shape="poly" coords="210,157, 210,157, 210,194, 210,194, 210,194, 333,194, 333,194, 333,194, 333,157, 333,157, 333,157, 210,157, 210,157" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/svm.html#regression" title="SVR Documentation" shape="poly" coords="1696,692, 1696,692, 1696,732, 1696,732, 1696,732, 1890,732, 1890,732, 1890,732, 1890,692, 1890,692, 1890,692, 1696,692, 1696,692" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/svm.html#regression" title="SVR Documentation" shape="poly" coords="1831,458, 1831,458, 1831,496, 1831,496, 1831,496, 2052,496, 2052,496, 2052,496, 2052,458, 2052,458, 2052,458, 1831,458, 1831,458" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
<area href="../../modules/mixture.html#bgmm" title=" Bayesian GMM Documentation" shape="poly" coords="562,994, 562,994, 562,1026, 562,1026, 562,1026, 682,1026, 682,1026, 682,1026, 682,994, 682,994, 682,994, 562,994, 562,994" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"66FF66","fillOpacity":0.4}'></area>
</map>
</img>
</div>
Loading
Loading