spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiangrui Meng (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (SPARK-1213) loss function error of logistic loss
Date Tue, 01 Apr 2014 06:34:14 GMT

     [ https://issues.apache.org/jira/browse/SPARK-1213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Xiangrui Meng resolved SPARK-1213.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.9.0

> loss function error of logistic loss
> ------------------------------------
>
>                 Key: SPARK-1213
>                 URL: https://issues.apache.org/jira/browse/SPARK-1213
>             Project: Spark
>          Issue Type: Bug
>          Components: MLlib
>            Reporter: Xusen Yin
>              Labels: MLLib,
>             Fix For: 0.9.0
>
>
> There might be a error in incubator-spark/mllib/src/main/scala/org/apache/spark/mllib/optimizatio/Gradient.scala
> The loss function of class LogisticGradient might be wrong.
> The original one is :
> val loss =
>   if (margin > 0) {
>       math.log(1 + math.exp(0 - margin))
>    } else {
>       math.log(1 + math.exp(margin)) - margin
>    }
> But when we use this kind of loss function, we will find that the loss is increasing
when optimizing, such as LogisticRegressionWithSGD.
> I think it should be something like this:
> val loss =
>       if (label > 0) {
>         math.log(1 + math.exp(margin))
>       } else {
>         math.log(1 + math.exp(margin)) - margin
>       }
> I tested the loss function. It works well.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message