-
- Downloads
[SPARK-4907][MLlib] Inconsistent loss and gradient in LeastSquaresGradient compared with R
In most of the academic paper and algorithm implementations, people use L = 1/2n ||A weights-y||^2 instead of L = 1/n ||A weights-y||^2 for least-squared loss. See Eq. (1) in http://web.stanford.edu/~hastie/Papers/glmnet.pdf Since MLlib uses different convention, this will result different residuals and all the stats properties will be different from GLMNET package in R. The model coefficients will be still the same under this change. Author: DB Tsai <dbtsai@alpinenow.com> Closes #3746 from dbtsai/lir and squashes the following commits: 19c2e85 [DB Tsai] make stepsize twice to converge to the same solution 0b2c29c [DB Tsai] first commit
Showing
- mllib/src/main/scala/org/apache/spark/mllib/optimization/Gradient.scala 5 additions, 5 deletions.../scala/org/apache/spark/mllib/optimization/Gradient.scala
- mllib/src/test/scala/org/apache/spark/mllib/regression/StreamingLinearRegressionSuite.scala 3 additions, 3 deletions...ark/mllib/regression/StreamingLinearRegressionSuite.scala
Please register or sign in to comment