Commit 51ba04d0 authored by Aqeel Padaria's avatar Aqeel Padaria

update

parent 1cc67b67
...@@ -945,6 +945,7 @@ server = shinyServer( ...@@ -945,6 +945,7 @@ server = shinyServer(
if(acctype %in% "Standard MAPE") if(acctype %in% "Standard MAPE")
{ {
accval <- 100*abs((origvals - origfit)/(origvals)) accval <- 100*abs((origvals - origfit)/(origvals))
accval[is.nan(accval)] <- 0
accval[is.infinite(accval)] <- 100 accval[is.infinite(accval)] <- 100
accval <- accval[!is.na(accval)] accval <- accval[!is.na(accval)]
accval <- max(100 - mean(accval), 0) accval <- max(100 - mean(accval), 0)
...@@ -953,7 +954,9 @@ server = shinyServer( ...@@ -953,7 +954,9 @@ server = shinyServer(
if(acctype %in% "Adjusted MAPE") if(acctype %in% "Adjusted MAPE")
{ {
accval <- 100*abs((origvals - origfit)/(origvals)) accval <- 100*abs((origvals - origfit)/(origvals))
accval[is.infinite(accval)] <- 100*abs((0 - origfit[is.infinite(accval)])/(mean(origvals,na.rm=TRUE))) accval[is.nan(accval)] <- 0
accval[is.infinite(accval)] <- 100*abs((0 - origfit[is.infinite(accval)])/(mean(origvals[origvals!=0],na.rm=TRUE)))
accval[is.nan(accval)] <- 0
accval[accval>100] <- 100 accval[accval>100] <- 100
accval <- accval[!is.na(accval)] accval <- accval[!is.na(accval)]
accval <- 100 - mean(accval) accval <- 100 - mean(accval)
...@@ -963,6 +966,7 @@ server = shinyServer( ...@@ -963,6 +966,7 @@ server = shinyServer(
if(acctype %in% "Weighted MAPE") if(acctype %in% "Weighted MAPE")
{ {
accval <- 100*abs((origvals - origfit)/(origfit)) accval <- 100*abs((origvals - origfit)/(origfit))
accval[is.nan(accval)] <- 0
accval[is.infinite(accval)] <- 100 accval[is.infinite(accval)] <- 100
accval <- accval[!is.na(accval)] accval <- accval[!is.na(accval)]
accval <- max(100 - mean(accval), 0) accval <- max(100 - mean(accval), 0)
...@@ -971,6 +975,7 @@ server = shinyServer( ...@@ -971,6 +975,7 @@ server = shinyServer(
if(acctype %in% "MdAPE") if(acctype %in% "MdAPE")
{ {
accval <- 100*abs((origvals - origfit)/(origvals)) accval <- 100*abs((origvals - origfit)/(origvals))
accval[is.nan(accval)] <- 0
accval[is.infinite(accval)] <- 100 accval[is.infinite(accval)] <- 100
accval <- accval[!is.na(accval)] accval <- accval[!is.na(accval)]
accval <- max(100 - median(accval), 0) accval <- max(100 - median(accval), 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment