[ https://issues.apache.org/jira/browse/SPARK-3181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384138#comment-15384138 ]
Yanbo Liang commented on SPARK-3181: ------------------------------------ [~dbtsai] Should the {{HuberRegression}} share codebase with {{LinearRegression}} in ML? I saw you suggested to do that. But I found it's hard to share codebase between the two regression methods although they accomplish the same goal. Since the output of {{fit}} will be different: {{LinearRegressionModel}} and {{HuberRegressionModel}}. The former only contains {{coefficients, intercept}}, but the latter contains {{coefficients, intercept, scale/sigma}}. It will also involve save/load compatibility issue if we combine the two model become one. One trick method is we can drop {{scale/sigma}} and make the {{fit}} by Huber cost function still output {{LinearRegressionModel}}, but I don't think it's an appropriate way. So I would like to implement {{HuberRegression}} in a separate file and looking forward to hear your thought. Thanks! > Add Robust Regression Algorithm with Huber Estimator > ---------------------------------------------------- > > Key: SPARK-3181 > URL: https://issues.apache.org/jira/browse/SPARK-3181 > Project: Spark > Issue Type: New Feature > Components: ML, MLlib > Reporter: Fan Jiang > Assignee: Yanbo Liang > Labels: features > Original Estimate: 0h > Remaining Estimate: 0h > > Linear least square estimates assume the error has normal distribution and > can behave badly when the errors are heavy-tailed. In practical we get > various types of data. We need to include Robust Regression to employ a > fitting criterion that is not as vulnerable as least square. > In 1973, Huber introduced M-estimation for regression which stands for > "maximum likelihood type". The method is resistant to outliers in the > response variable and has been widely used. > The new feature for MLlib will contain 3 new files > /main/scala/org/apache/spark/mllib/regression/RobustRegression.scala > /test/scala/org/apache/spark/mllib/regression/RobustRegressionSuite.scala > /main/scala/org/apache/spark/examples/mllib/HuberRobustRegression.scala > and one new class HuberRobustGradient in > /main/scala/org/apache/spark/mllib/optimization/Gradient.scala -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org