Skip to content

Commit

Permalink
Merge pull request scikit-learn#4723 from amueller/backlinks
Browse files Browse the repository at this point in the history
[MRG] website: adding backlinks to docstrings
  • Loading branch information
amueller committed Jun 3, 2015
2 parents 05ad745 + 0650d55 commit ec2fd72
Show file tree
Hide file tree
Showing 121 changed files with 818 additions and 121 deletions.
16 changes: 4 additions & 12 deletions doc/modules/clustering.rst
Original file line number Diff line number Diff line change
Expand Up @@ -879,13 +879,11 @@ classes according to some similarity metric.

.. currentmodule:: sklearn.metrics

.. _adjusted_rand_score:

Adjusted Rand index
-------------------

Presentation and usage
~~~~~~~~~~~~~~~~~~~~~~

Given the knowledge of the ground truth class assignments ``labels_true``
and our clustering algorithm assignments of the same samples
``labels_pred``, the **adjusted Rand index** is a function that measures
Expand Down Expand Up @@ -1000,13 +998,11 @@ random labelings by defining the adjusted Rand index as follows:
* `Wikipedia entry for the adjusted Rand index
<http://en.wikipedia.org/wiki/Rand_index#Adjusted_Rand_index>`_

.. _mutual_info_score:

Mutual Information based scores
-------------------------------

Presentation and usage
~~~~~~~~~~~~~~~~~~~~~~

Given the knowledge of the ground truth class assignments ``labels_true`` and
our clustering algorithm assignments of the same samples ``labels_pred``, the
**Mutual Information** is a function that measures the **agreement** of the two
Expand Down Expand Up @@ -1168,12 +1164,11 @@ calculated using a similar form to that of the adjusted Rand index:
* `Wikipedia entry for the Adjusted Mutual Information
<http://en.wikipedia.org/wiki/Adjusted_Mutual_Information>`_

.. _homogeneity_completeness:

Homogeneity, completeness and V-measure
---------------------------------------

Presentation and usage
~~~~~~~~~~~~~~~~~~~~~~

Given the knowledge of the ground truth class assignments of the samples,
it is possible to define some intuitive metric using conditional entropy
analysis.
Expand Down Expand Up @@ -1329,9 +1324,6 @@ mean of homogeneity and completeness**:
Silhouette Coefficient
----------------------

Presentation and usage
~~~~~~~~~~~~~~~~~~~~~~

If the ground truth labels are not known, evaluation must be performed using
the model itself. The Silhouette Coefficient
(:func:`sklearn.metrics.silhouette_score`)
Expand Down
1 change: 1 addition & 0 deletions doc/modules/covariance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ paper. It is the same algorithm as in the R ``glasso`` package.
graphical lasso" <http://biostatistics.oxfordjournals.org/content/9/3/432.short>`_,
Biostatistics 9, pp 432, 2008

.. _robust_covariance:

Robust Covariance Estimation
============================
Expand Down
6 changes: 3 additions & 3 deletions doc/modules/decomposition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,9 @@ structure of the error covariance :math:`\Psi`:
* :math:`\Psi = \sigma^2 \mathbf{I}`: This assumption leads to
the probabilistic model of :class:`PCA`.

* :math:`\Psi = diag(\psi_1, \psi_2, \dots, \psi_n)`: This model is called Factor
Analysis, a classical statistical model. The matrix W is sometimes called
the "factor loading matrix".
* :math:`\Psi = diag(\psi_1, \psi_2, \dots, \psi_n)`: This model is called
:class:`FactorAnalysis`, a classical statistical model. The matrix W is
sometimes called the "factor loading matrix".

Both model essentially estimate a Gaussian with a low-rank covariance matrix.
Because both models are probabilistic they can be integrated in more complex
Expand Down
10 changes: 6 additions & 4 deletions doc/modules/ensemble.rst
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,8 @@ accessed via the ``feature_importances_`` property::

.. currentmodule:: sklearn.ensemble.partial_dependence

.. _partial_dependence:

Partial dependence
..................

Expand Down Expand Up @@ -989,10 +991,10 @@ calculated as follows:
================ ========== ========== ==========
classifier class 1 class 2 class 3
================ ========== ========== ==========
classifier 1 w1 * 0.2 w1 * 0.5 w1 * 0.3
classifier 2 w2 * 0.6 w2 * 0.3 w2 * 0.1
classifier 1 w1 * 0.2 w1 * 0.5 w1 * 0.3
classifier 2 w2 * 0.6 w2 * 0.3 w2 * 0.1
classifier 3 w3 * 0.3 w3 * 0.4 w3 * 0.3
weighted average 0.37 0.4 0.3
weighted average 0.37 0.4 0.3
================ ========== ========== ==========

Here, the predicted class label is 2, since it has the
Expand Down Expand Up @@ -1031,7 +1033,7 @@ Vector Machine, a Decision Tree, and a K-nearest neighbor classifier::
:scale: 75%

Using the `VotingClassifier` with `GridSearch`
---------------------------------------------
----------------------------------------------

The `VotingClassifier` can also be used together with `GridSearch` in order
to tune the hyperparameters of the individual estimators::
Expand Down
1 change: 1 addition & 0 deletions doc/modules/feature_extraction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ Some tips and tricks:
Customizing the vectorizer can also be useful when handling Asian languages
that do not use an explicit word separator such as whitespace.

.. _image_feature_extraction:

Image feature extraction
========================
Expand Down
5 changes: 5 additions & 0 deletions doc/modules/feature_selection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ improve estimators' accuracy scores or to boost their performance on very
high-dimensional datasets.


.. _variance_threshold:

Removing features with low variance
===================================

Expand Down Expand Up @@ -45,6 +47,8 @@ so we can select using the threshold ``.8 * (1 - .8)``::
As expected, ``VarianceThreshold`` has removed the first column,
which has a probability :math:`p = 5/6 > .8` of containing a zero.

.. _univariate_feature_selection:

Univariate feature selection
============================

Expand Down Expand Up @@ -101,6 +105,7 @@ univariate p-values:

:ref:`example_feature_selection_plot_feature_selection.py`

.. _rfe:

Recursive feature elimination
=============================
Expand Down
2 changes: 2 additions & 0 deletions doc/modules/grid_search.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ evaluated and the best combination is retained.
classifier (here a linear SVM trained with SGD with either elastic
net or L2 penalty) using a :class:`pipeline.Pipeline` instance.

.. _randomized_parameter_search:

Randomized Parameter Optimization
=================================
While using a grid of parameter settings is currently the most widely used
Expand Down
3 changes: 3 additions & 0 deletions doc/modules/kernel_approximation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ kernel function or a precomputed kernel matrix.
The number of samples used - which is also the dimensionality of the features computed -
is given by the parameter ``n_components``.

.. _rbf_kernel_approx:

Radial Basis Function Kernel
----------------------------
Expand Down Expand Up @@ -98,6 +99,7 @@ use of larger feature spaces more efficient.

* :ref:`example_plot_kernel_approximation.py`

.. _additive_chi_kernel_approx:

Additive Chi Squared Kernel
---------------------------
Expand Down Expand Up @@ -130,6 +132,7 @@ with the approximate feature map provided by :class:`RBFSampler` to yield an app
feature map for the exponentiated chi squared kernel.
See the [VZ2010]_ for details and [VVZ2010]_ for combination with the :class:`RBFSampler`.

.. _skewed_chi_kernel_approx:

Skewed Chi Squared Kernel
-------------------------
Expand Down
6 changes: 6 additions & 0 deletions doc/modules/linear_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ They also tend to break when the problem is badly conditioned

* :ref:`example_linear_model_plot_lasso_model_selection.py`

.. _elastic_net:

Elastic Net
===========
Expand Down Expand Up @@ -486,6 +487,9 @@ previously chosen dictionary elements.
<http://blanche.polytechnique.fr/~mallat/papiers/MallatPursuit93.pdf>`_,
S. G. Mallat, Z. Zhang,


.. _bayesian_regression:

Bayesian Regression
===================

Expand Down Expand Up @@ -752,6 +756,8 @@ while with ``loss="hinge"`` it fits a linear support vector machine (SVM).

* :ref:`sgd`

.. _perceptron:

Perceptron
==========

Expand Down
1 change: 1 addition & 0 deletions doc/modules/manifold.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ The overall complexity of Isomap is
<http://www.sciencemag.org/content/290/5500/2319.full>`_
Tenenbaum, J.B.; De Silva, V.; & Langford, J.C. Science 290 (5500)

.. _locally_linear_embedding:

Locally Linear Embedding
========================
Expand Down
12 changes: 12 additions & 0 deletions doc/modules/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ the kernel:

.. currentmodule:: sklearn.metrics.pairwise

.. _cosine_similarity:

Cosine similarity
-----------------
:func:`cosine_similarity` computes the L2-normalized dot product of vectors.
Expand Down Expand Up @@ -63,6 +65,8 @@ is equivalent to :func:`linear_kernel`, only slower.)
Information Retrieval. Cambridge University Press.
http://nlp.stanford.edu/IR-book/html/htmledition/the-vector-space-model-for-scoring-1.html

.. _linear_kernel:

Linear kernel
-------------
The function :func:`linear_kernel` computes the linear kernel, that is, a
Expand All @@ -73,6 +77,8 @@ If ``x`` and ``y`` are column vectors, their linear kernel is:
k(x, y) = x^\top y
.. _polynomial_kernel:

Polynomial kernel
-----------------
The function :func:`polynomial_kernel` computes the degree-d polynomial kernel
Expand All @@ -94,6 +100,8 @@ where:

If :math:`c_0 = 0` the kernel is said to be homogeneous.

.. _sigmoid_kernel:

Sigmoid kernel
--------------
The function :func:`sigmoid_kernel` computes the sigmoid kernel between two
Expand All @@ -111,6 +119,8 @@ where:
* :math:`\gamma` is known as slope
* :math:`c_0` is known as intercept

.. _rbf_kernel:

RBF kernel
----------
The function :func:`rbf_kernel` computes the radial basis function (RBF) kernel
Expand All @@ -123,6 +133,8 @@ between two vectors. This kernel is defined as:
where ``x`` and ``y`` are the input vectors. If :math:`\gamma = \sigma^{-2}`
the kernel is known as the Gaussian kernel of variance :math:`\sigma^2`.

.. _chi2_kernel:

Chi-squared kernel
------------------
The chi-squared kernel is a very popular choice for training non-linear SVMs in
Expand Down
1 change: 1 addition & 0 deletions doc/modules/mixture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ parameters to maximize the likelihood of the data given those
assignments. Repeating this process is guaranteed to always converge
to a local optimum.

.. _vbgmm:

VBGMM classifier: variational Gaussian mixtures
================================================
Expand Down

0 comments on commit ec2fd72

Please sign in to comment.