DOC: finish misc in tutorial
@jaquesgrobler : there were still a few things to do :)
This commit is contained in:
parent
43ca4b75ea
commit
7278dfe482
|
|
@ -1,10 +0,0 @@
|
|||
|
||||
Exercise: setting sparsity on diabetes
|
||||
========================================
|
||||
|
||||
.. literalinclude:: ../../auto_examples/exercises/plot_cv_diabetes.py
|
||||
:lines: 1-13
|
||||
|
||||
Solution: :download:`../../auto_examples/exercises/plot_cv_diabetes.py`
|
||||
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
|
||||
Excercice: classification of digits
|
||||
====================================
|
||||
|
||||
.. literalinclude:: ../../auto_examples/exercises/plot_digits_classification_exercise.py
|
||||
:lines: 1-5
|
||||
|
||||
Solution: :download:`../../auto_examples/exercises/plot_digits_classification_exercise.py`
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
.. _digits_cv_ex:
|
||||
|
||||
Exercise: model selection on digits
|
||||
=====================================
|
||||
|
||||
.. literalinclude:: ../../auto_examples/exercises/plot_cv_digits.py
|
||||
:lines: 1-9
|
||||
|
||||
Solution: :download:`../../auto_examples/exercises/plot_cv_digits.py`
|
||||
|
||||
|
||||
|
|
@ -26,8 +26,6 @@ Statistical-learning for scientific data processing tutorial
|
|||
|
||||
.. include:: ../../includes/big_toc_css.rst
|
||||
|
||||
.. note:: This document is meant to be used with **scikit-learn version 0.7+**.
|
||||
|
||||
.. warning::
|
||||
|
||||
In scikit-learn release 0.9, the import path has changed from
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
Exercise: classification of iris
|
||||
====================================
|
||||
|
||||
.. literalinclude:: ../../auto_examples/exercises/plot_iris_exercise.py
|
||||
:lines: 1-10
|
||||
|
||||
Solution: :download:`../../auto_examples/exercises/plot_iris_exercise.py`
|
||||
|
||||
|
|
@ -105,12 +105,12 @@ of the computer.
|
|||
|
||||
- Takes a label array to group observations
|
||||
|
||||
.. currentmodule:: sklearn.svm
|
||||
|
||||
.. image:: ../../auto_examples/exercises/images/plot_cv_digits_1.png
|
||||
:target: ../../tutorial/statistical_inference/digits_cv_exercise.html
|
||||
:align: right
|
||||
:scale: 75
|
||||
|
||||
.. currentmodule:: sklearn.svm
|
||||
:scale: 100
|
||||
|
||||
.. topic:: **Exercise**
|
||||
:class: green
|
||||
|
|
@ -119,9 +119,12 @@ of the computer.
|
|||
estimator with an RBF kernel as a function of parameter `C` (use a
|
||||
logarithmic grid of points, from `1` to `10`).
|
||||
|
||||
.. toctree::
|
||||
.. literalinclude:: ../../auto_examples/exercises/plot_cv_digits.py
|
||||
:lines: 13-23
|
||||
|
||||
Solution: :download:`../../auto_examples/exercises/plot_cv_digits.py`
|
||||
|
||||
|
||||
digits_cv_exercise.rst
|
||||
|
||||
Grid-search and cross-validated estimators
|
||||
============================================
|
||||
|
|
@ -209,6 +212,9 @@ appended to their name.
|
|||
|
||||
**Bonus**: How much can you trust the selection of alpha?
|
||||
|
||||
.. toctree::
|
||||
.. literalinclude:: ../../auto_examples/exercises/plot_cv_diabetes.py
|
||||
:lines: 11-23
|
||||
|
||||
Solution: :download:`../../auto_examples/exercises/plot_cv_diabetes.py`
|
||||
|
||||
|
||||
diabetes_cv_exercise
|
||||
|
|
|
|||
|
|
@ -401,9 +401,11 @@ This is known as :class:`LogisticRegression`.
|
|||
model. Leave out the last 10% and test prediction performance on these
|
||||
observations.
|
||||
|
||||
.. toctree::
|
||||
.. literalinclude:: ../../auto_examples/exercises/plot_digits_classification_exercise.py
|
||||
:lines: 12-17
|
||||
|
||||
Solution: :download:`../../auto_examples/exercises/plot_digits_classification_exercise.py`
|
||||
|
||||
digits_classification_exercise
|
||||
|
||||
Support vector machines (SVMs)
|
||||
================================
|
||||
|
|
@ -551,27 +553,23 @@ creating an decision energy by positioning *kernels* on observations:
|
|||
:align: right
|
||||
:scale: 70
|
||||
|
||||
.. topic:: **Excercise**
|
||||
.. topic:: **Exercise**
|
||||
:class: green
|
||||
|
||||
Try classifying classes 1 and 2 from the iris dataset with SVMs, with
|
||||
the 2 first features. Leave out 10% of each class and test prediction
|
||||
performance on these observations.
|
||||
|
||||
The solution is available below:
|
||||
|
||||
.. toctree::
|
||||
|
||||
iris_classification_exercise.rst
|
||||
|
||||
**Warning**: the classes are ordered, do not leave out the last 10%,
|
||||
you would be testing on only one class.
|
||||
|
||||
**Hint**: You can use the `decision_function` method on a grid to get
|
||||
intuitions.
|
||||
|
||||
..
|
||||
Gaussian process: introducing the notion of posterior estimate
|
||||
===============================================================
|
||||
.. literalinclude:: ../../auto_examples/exercises/plot_iris_exercise.py
|
||||
:lines: 15-22
|
||||
|
||||
Solution: :download:`../../auto_examples/exercises/plot_iris_exercise.py`
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,12 @@ from sklearn import cluster
|
|||
n_clusters = 5
|
||||
np.random.seed(0)
|
||||
|
||||
lena = sp.lena()
|
||||
try:
|
||||
lena = sp.lena()
|
||||
except AttributeError:
|
||||
# Newer versions of scipy have lena in misc
|
||||
from scipy import misc
|
||||
lena = misc.lena()
|
||||
X = lena.reshape((-1, 1)) # We need an (n_sample, n_feature) array
|
||||
k_means = cluster.KMeans(k=n_clusters, n_init=4)
|
||||
k_means.fit(X)
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@
|
|||
Cross-validation on diabetes Dataset Exercise
|
||||
===============================================
|
||||
|
||||
This exercise is used in the
|
||||
:ref:`cv_estimators_tut` part of the
|
||||
:ref:`model_selection_tut` section of the
|
||||
:ref:`stat_learn_tut_index`.
|
||||
This exercise is used in the :ref:`cv_estimators_tut` part of the
|
||||
:ref:`model_selection_tut` section of the :ref:`stat_learn_tut_index`.
|
||||
"""
|
||||
print __doc__
|
||||
|
||||
import numpy as np
|
||||
import pylab as pl
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
Digits Classification Exercise
|
||||
================================
|
||||
|
||||
This exercise is used in the
|
||||
:ref:`clf_tut` part of the
|
||||
This exercise is used in the :ref:`clf_tut` part of the
|
||||
:ref:`supervised_learning_tut` section of the
|
||||
:ref:`stat_learn_tut_index`.
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue