aboutsummaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorDB Tsai <dbtsai@alpinenow.com>2014-08-14 11:56:13 -0700
committerXiangrui Meng <meng@databricks.com>2014-08-14 11:56:13 -0700
commit96221067572e5955af1a7710b0cca33a73db4bd5 (patch)
tree9e844dfef5c98dafae19d3c1fd55a8eed3c7e570 /sql
parenteaeb0f76fa0f103c7db0f3975cb8562715410973 (diff)
downloadspark-96221067572e5955af1a7710b0cca33a73db4bd5.tar.gz
spark-96221067572e5955af1a7710b0cca33a73db4bd5.tar.bz2
spark-96221067572e5955af1a7710b0cca33a73db4bd5.zip
[SPARK-2979][MLlib] Improve the convergence rate by minimizing the condition number
In theory, the scale of your inputs are irrelevant to logistic regression. You can "theoretically" multiply X1 by 1E6 and the estimate for β1 will adjust accordingly. It will be 1E-6 times smaller than the original β1, due to the invariance property of MLEs. However, during the optimization process, the convergence (rate) depends on the condition number of the training dataset. Scaling the variables often reduces this condition number, thus improving the convergence rate. Without reducing the condition number, some training datasets mixing the columns with different scales may not be able to converge. GLMNET and LIBSVM packages perform the scaling to reduce the condition number, and return the weights in the original scale. See page 9 in http://cran.r-project.org/web/packages/glmnet/glmnet.pdf Here, if useFeatureScaling is enabled, we will standardize the training features by dividing the variance of each column (without subtracting the mean to densify the sparse vector), and train the model in the scaled space. Then we transform the coefficients from the scaled space to the original scale as GLMNET and LIBSVM do. Currently, it's only enabled in LogisticRegressionWithLBFGS. Author: DB Tsai <dbtsai@alpinenow.com> Closes #1897 from dbtsai/dbtsai-feature-scaling and squashes the following commits: f19fc02 [DB Tsai] Added more comments 1d85289 [DB Tsai] Improve the convergence rate by minimize the condition number in LOR with LBFGS
Diffstat (limited to 'sql')
0 files changed, 0 insertions, 0 deletions