From 6d2e4730ef110eadb1d9cddca3726c63a208e915 Mon Sep 17 00:00:00 2001 From: Gael varoquaux <gael.varoquaux@normalesup.org> Date: Sat, 11 Sep 2010 11:02:28 +0200 Subject: [PATCH] MISC: Fix spelling. Thanks to Keith Goodman and Joseph Perktold for reporting. --- doc/developers/index.rst | 2 +- doc/modules/glm.rst | 4 +- scikits/learn/datasets/samples_generator.py | 19 ++++---- scikits/learn/glm/bayes.py | 48 ++++++++++----------- 4 files changed, 36 insertions(+), 37 deletions(-) diff --git a/doc/developers/index.rst b/doc/developers/index.rst index 047f9cea82..f53bc7baa9 100644 --- a/doc/developers/index.rst +++ b/doc/developers/index.rst @@ -240,7 +240,7 @@ this is left to the ``fit()`` method:: The arguments that go in the `__init__` should all be keyword arguments -with a defaut value. In other words, a user should be able to instanciate +with a default value. In other words, a user should be able to instanciate an estimator without passing to it any arguments. The arguments in given at instanciation of an estimator should all diff --git a/doc/modules/glm.rst b/doc/modules/glm.rst index a9476dda9a..56c58e94f7 100644 --- a/doc/modules/glm.rst +++ b/doc/modules/glm.rst @@ -110,13 +110,13 @@ regularizer. The objective function to minimize is: .. math:: 0.5 * ||y - X w||_2 ^ 2 + \alpha * ||w||_1 -The lasso estimate solves thus solves the minization of the +The lasso estimate thus solves the minization of the least-squares penalty with :math:`\alpha * ||w||_1` added, where :math:`\alpha` is a constant and :math:`||w||_1` is the L1-norm of the parameter vector. -This formulation is useful in some context due to its tendency to +This formulation is useful in some contexts due to its tendency to prefer solutions with fewer parameter values, effectively reducing the number of variables upon which the given solution is dependent. For this reason, the Lasso and its variants are fundamental to the field diff --git a/scikits/learn/datasets/samples_generator.py b/scikits/learn/datasets/samples_generator.py index cea4b91728..8eae1ed7f4 100644 --- a/scikits/learn/datasets/samples_generator.py +++ b/scikits/learn/datasets/samples_generator.py @@ -1,15 +1,14 @@ -import numpy as np -import numpy.random as nr - - """ -Samples generator - +Generate samples of synthetic data sets. """ # Author: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel # License: BSD 3 clause +import numpy as np +import numpy.random as nr + + def samples_classif(): pass @@ -122,9 +121,9 @@ def sparse_uncorrelated(nb_samples=100, nb_features=10): Parameters ---------- nb_samples : int - number of samples (defaut is 100). + number of samples (default is 100). nb_features : int - number of features (defaut is 5). + number of features (default is 5). Returns ------- @@ -148,9 +147,9 @@ def friedman(nb_samples=100, nb_features=10,noise_std=1): Parameters ---------- nb_samples : int - number of samples (defaut is 100). + number of samples (default is 100). nb_features : int - number of features (defaut is 10). + number of features (default is 10). noise_std : float std of the noise, which is added as noise_std*NR.normal(0,1) Returns diff --git a/scikits/learn/glm/bayes.py b/scikits/learn/glm/bayes.py index 9768d67c9d..bf4246316f 100644 --- a/scikits/learn/glm/bayes.py +++ b/scikits/learn/glm/bayes.py @@ -29,25 +29,25 @@ class BayesianRidge(LinearModel): Y : numpy array of shape (length) Target values for training vectors - n_iter : int (defaut is 300) + n_iter : int (default is 300) Maximum number of interations. - eps : float (defaut is 1.e-3) + eps : float (default is 1.e-3) Stop the algorithm if w has converged. - alpha_1 : float (defaut is 1.e-6) + alpha_1 : float (default is 1.e-6) Hyper-parameter : shape parameter for the Gamma distribution prior over the alpha parameter. - alpha_2 : float (defaut is 1.e-6) + alpha_2 : float (default is 1.e-6) Hyper-parameter : inverse scale parameter (rate parameter) for the Gamma distribution prior over the alpha parameter. - lambda_1 : float (defaut is 1.e-6) + lambda_1 : float (default is 1.e-6) Hyper-parameter : shape parameter for the Gamma distribution prior over the lambda parameter. - lambda_2 : float (defaut is 1.e-6) + lambda_2 : float (default is 1.e-6) Hyper-parameter : inverse scale parameter (rate parameter) for the Gamma distribution prior over the lambda parameter. @@ -95,25 +95,25 @@ class BayesianRidge(LinearModel): """ Parameters ---------- - n_iter : int (defaut is 300) + n_iter : int (default is 300) Maximum number of interations. - eps : float (defaut is 1.e-3) + eps : float (default is 1.e-3) Stop the algorithm if w has converged. - alpha_1 : float (defaut is 1.e-6) + alpha_1 : float (default is 1.e-6) Hyper-parameter : shape parameter for the Gamma distribution prior over the alpha parameter. - alpha_2 : float (defaut is 1.e-6) + alpha_2 : float (default is 1.e-6) Hyper-parameter : inverse scale parameter (rate parameter) for the Gamma distribution prior over the alpha parameter. - lambda_1 : float (defaut is 1.e-6) + lambda_1 : float (default is 1.e-6) Hyper-parameter : shape parameter for the Gamma distribution prior over the lambda parameter. - lambda_2 : float (defaut is 1.e-6) + lambda_2 : float (default is 1.e-6) Hyper-parameter : inverse scale parameter (rate parameter) for the Gamma distribution prior over the lambda parameter. @@ -264,25 +264,25 @@ class ARDRegression(LinearModel): Y : numpy array of shape (length) Target values for training vectors - n_iter : int (defaut is 300) + n_iter : int (default is 300) Maximum number of interations. - eps : float (defaut is 1.e-3) + eps : float (default is 1.e-3) Stop the algorithm if w has converged. - alpha_1 : float (defaut is 1.e-6) + alpha_1 : float (default is 1.e-6) Hyper-parameter : shape parameter for the Gamma distribution prior over the alpha parameter. - alpha_2 : float (defaut is 1.e-6) + alpha_2 : float (default is 1.e-6) Hyper-parameter : inverse scale parameter (rate parameter) for the Gamma distribution prior over the alpha parameter. - lambda_1 : float (defaut is 1.e-6) + lambda_1 : float (default is 1.e-6) Hyper-parameter : shape parameter for the Gamma distribution prior over the lambda parameter. - lambda_2 : float (defaut is 1.e-6) + lambda_2 : float (default is 1.e-6) Hyper-parameter : inverse scale parameter (rate parameter) for the Gamma distribution prior over the lambda parameter. @@ -335,25 +335,25 @@ class ARDRegression(LinearModel): """ Parameters ---------- - n_iter : int (defaut is 300) + n_iter : int (default is 300) Maximum number of interations. - eps : float (defaut is 1.e-3) + eps : float (default is 1.e-3) Stop the algorithm if w has converged. - alpha_1 : float (defaut is 1.e-6) + alpha_1 : float (default is 1.e-6) Hyper-parameter : shape parameter for the Gamma distribution prior over the alpha parameter. - alpha_2 : float (defaut is 1.e-6) + alpha_2 : float (default is 1.e-6) Hyper-parameter : inverse scale parameter (rate parameter) for the Gamma distribution prior over the alpha parameter. - lambda_1 : float (defaut is 1.e-6) + lambda_1 : float (default is 1.e-6) Hyper-parameter : shape parameter for the Gamma distribution prior over the lambda parameter. - lambda_2 : float (defaut is 1.e-6) + lambda_2 : float (default is 1.e-6) Hyper-parameter : inverse scale parameter (rate parameter) for the Gamma distribution prior over the lambda parameter. -- GitLab