Github user dbtsai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8013#discussion_r36719632
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala ---
    @@ -645,3 +658,80 @@ private class LeastSquaresCostFun(
         (leastSquaresAggregator.loss + regVal, new BDV(totalGradientArray))
       }
     }
    +
    +/**
    + * HuberCostFun implements Breeze's DiffFunction[T] for Huber cost as used 
in Robust regression.
    + * The Huber M-estimator corresponds to a probability distribution for the 
errors which is normal
    + * in the centre but like a double exponential distribution in the tails 
(Hogg 1979: 109).
    + * L = 1/2 ||A weights-y||^2 if |A weights-y| <= k
    + * L = k |A weights-y| - 1/2 K^2 if |A weights-y| > k
    + * where k = 1.345 which produce 95% efficiency when the errors are normal 
and
    --- End diff --
    
    BTW, will be nice that users can set % of efficiency instead of 1.345 this 
kind of magic number.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to