Skip to content

Commit

Permalink
version 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyachen authored and cran-robot committed May 13, 2016
1 parent f1284da commit 8ed8f93
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
@@ -1,7 +1,7 @@
Package: MLmetrics
Type: Package
Title: Machine Learning Evaluation Metrics
Version: 1.1.0
Version: 1.1.1
Authors@R: person("Yachen", "Yan", email = "yanyachen21@gmail.com", role = c("aut", "cre"))
Description: A collection of evaluation metrics, including loss, score and
utility functions, that measure regression, classification and ranking performance.
Expand All @@ -14,8 +14,8 @@ License: GPL-2
LazyData: true
RoxygenNote: 5.0.1
NeedsCompilation: no
Packaged: 2016-05-01 11:07:14 UTC; Administrator
Packaged: 2016-05-09 06:13:55 UTC; Administrator
Author: Yachen Yan [aut, cre]
Maintainer: Yachen Yan <yanyachen21@gmail.com>
Repository: CRAN
Date/Publication: 2016-05-01 18:32:12
Date/Publication: 2016-05-13 23:57:26
8 changes: 4 additions & 4 deletions MD5
@@ -1,7 +1,7 @@
d7b7368243655ee5304ada439ca9451a *DESCRIPTION
7effa637d79decd846a0a621308cd92f *NAMESPACE
c25b4cbfe6164da84e7c7bd33b366d52 *DESCRIPTION
a2f973d4508642440a922397320545f9 *NAMESPACE
44c40b30f892bb85db6c56d93e75e4ac *R/Classification.R
77dce5a5d732eef51c1cfc010363df7b *R/Count.R
7967e8f036200816909e52bb6e1d38f3 *R/Count.R
556b2f37d8641c9ed02933c54ef7c368 *R/MLmetrics.R
d41d8cd98f00b204e9800998ecf8427e *R/Rank.R
ade5da8623726eba10bad8bcb98351dc *R/Regression.R
Expand All @@ -27,7 +27,7 @@ e594715ad175e7d58740b41d2a3fb0ca *man/MedianAE.Rd
337cacbd020fdea0ca40f9769e02c3b4 *man/MultiLogLoss.Rd
ee842fd12312073d812bf0c88fe6c21d *man/NormalizedGini.Rd
96fc35f78ff2fdccc22de51d895308e6 *man/PRAUC.Rd
a70115966d9d9ed107edf297c5a7751b *man/Possion_LogLoss.Rd
abf94a4bd0955312dd7cb8b781099038 *man/Poisson_LogLoss.Rd
3f0b82a06a53da4e19499280ae8d7ff9 *man/Precision.Rd
787ec83fe010b999aa235ff1ba14128b *man/R2_Score.Rd
ae9c96a8338363be60d822347d8cb41e *man/RAE.Rd
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Expand Up @@ -20,7 +20,7 @@ export(MedianAPE)
export(MultiLogLoss)
export(NormalizedGini)
export(PRAUC)
export(Possion_LogLoss)
export(Poisson_LogLoss)
export(Precision)
export(R2_Score)
export(RAE)
Expand Down
12 changes: 6 additions & 6 deletions R/Count.R
@@ -1,4 +1,4 @@
#' @title Possion Log loss
#' @title Poisson Log loss
#'
#' @description
#' Compute the log loss/cross-entropy loss.
Expand All @@ -11,15 +11,15 @@
#' counts = c(18,17,15,20,10,20,25,13,12))
#' glm_poisson <- glm(counts ~ outcome + treatment,
#' family = poisson(link = "log"), data = d_AD)
#' Possion_LogLoss(y_pred = glm_poisson$fitted.values, y_true = d_AD$counts)
#' Poisson_LogLoss(y_pred = glm_poisson$fitted.values, y_true = d_AD$counts)
#' @export

Possion_LogLoss <- function(y_pred, y_true) {
Poisson_LogLoss <- function(y_pred, y_true) {
eps <- 1e-15
y_pred <- pmax(y_pred, eps)
Possion_LogLoss <- mean(log(gamma(y_true + 1)) + y_pred - log(y_pred) * y_true)
# Possion_LogLoss <- mean(-dpois(y_true, y_pred, log = TRUE))
return(Possion_LogLoss)
Poisson_LogLoss <- mean(log(gamma(y_true + 1)) + y_pred - log(y_pred) * y_true)
# Poisson_LogLoss <- mean(-dpois(y_true, y_pred, log = TRUE))
return(Poisson_LogLoss)
}


Expand Down
10 changes: 5 additions & 5 deletions man/Possion_LogLoss.Rd → man/Poisson_LogLoss.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8ed8f93

Please sign in to comment.