spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkbradley <>
Subject [GitHub] spark pull request: [SPARK-11959] [SPARK-15484] [Doc] [ML] Documen...
Date Mon, 23 May 2016 17:05:21 GMT
Github user jkbradley commented on a diff in the pull request:
    --- Diff: docs/ ---
    @@ -4,10 +4,85 @@ title: Advanced topics -
     displayTitle: Advanced topics -
    -# Optimization of linear methods
    +* Table of contents
    +# Optimization of linear methods (developer)
    +## Limited-memory BFGS (L-BFGS)
    +[L-BFGS]( is an optimization 
    +algorithm in the family of quasi-Newton methods to solve the optimization problems of
the form 
    +`$\min_{\wv \in\R^d} \; f(\wv)$`. The L-BFGS method approximates the objective function
locally as a 
    +quadratic without evaluating the second partial derivatives of the objective function
to construct the 
    +Hessian matrix. The Hessian matrix is approximated by previous gradient evaluations,
so there is no 
    +vertical scalability issue (the number of training features) when computing the Hessian
    +explicitly in Newton's method. As a result, L-BFGS often achieves faster convergence
compared with 
    +other first-order optimizations.
    -The optimization algorithm underlying the implementation is called
     [Orthant-Wise Limited-memory
    -(OWL-QN). It is an extension of L-BFGS that can effectively handle L1
    -regularization and elastic net.
    +(OWL-QN) is an extension of L-BFGS that can effectively handle L1 regularization and
elastic net.
    +L-BFGS is used as a solver for [LinearRegression](api/scala/,
    +and [MultilayerPerceptronClassifier](api/scala/
    +The `` L-BFGS solver calls the corresponding implementation in [breeze](
    +## Normal equation solver for weighted least squares (normal)
    +`` implements normal equation solver for weighted least squares by [WeightedLeastSquares](
    +Given $n$ weighted observations $(w_i, a_i, b_i)$:
    +* $w_i$ the weight of i-th observation
    +* $a_i$ the features vector of i-th observation
    +* $b_i$ the label of i-th observation
    +The number of features for each observation is $m$. We use the following weighted least
squares formulation:
    +minimize_{x}\frac{1}{2} \sum_{i=1}^n \frac{w_i(a_i^T x -b_i)^2}{\sum_{i=1}^n w_i} + \frac{1}{2}\frac{\lambda}{\delta}\sum_{j=1}^m(\sigma_{j}
    +where $\lambda$ is the regularization parameter, $\delta$ is the population standard
deviation of label
    +and $\sigma_j$ is the population standard deviation of the j-th feature column.
    +This objective function has an analytic solution and it requires only one pass over the
data to collect necessary statistics to solve.
    +Unlike the original dataset which can only be stored in distributed system,
    +these statistics can be easily loaded into memory on a single machine, and then we can
solve the objective function through Cholesky factorization on the driver.
    +WeightedLeastSquares only supports L2 regularization and provides options to enable or
disable regularization, standardizing features and labels.
    +In order to take the normal equation approach efficiently, WeightedLeastSquares only
supports the number of features is no more than 4096.
    +## Iteratively re-weighted least squares (IRLS)
    +`` implements iteratively reweighted least squares (IRLS) by [IterativelyReweightedLeastSquares](
    +It can be used to find the maximum likelihood estimates of a generalized linear model
(GLM), find M-estimator in robust regression and other optimization problems.
    +Refer to [Iteratively Reweighted Least Squares for Maximum Likelihood Estimation, and
some Robust and Resistant Alternatives]( for more information.
    +It solves certain optimization problems iteratively:
    +* linearize the objective at current solution and update corresponding weight.
    +* solve a weighted least squares (WLS) problem by WeightedLeastSquares.
    +* repeat above steps until convergence.
    +Due to it involves solving a weighted least squares (WLS) problem by WeightedLeastSquares
in each step of the iteration,
    --- End diff --
    "Due to it" --> "Since it"
    "each step of the iteration" --> "each iteration"

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message