From: Benjamin Auder Date: Thu, 4 May 2017 19:15:27 +0000 (+0200) Subject: 'update' X-Git-Url: https://git.auder.net/app_dev.php/js/current/img/cross.svg?a=commitdiff_plain;h=10886062b38b7373ce6f418b6df6da16badd9393;p=talweg.git 'update' --- diff --git a/pkg/R/F_Neighbors.R b/pkg/R/F_Neighbors.R index 17fdd58..eb0dd79 100644 --- a/pkg/R/F_Neighbors.R +++ b/pkg/R/F_Neighbors.R @@ -140,7 +140,7 @@ NeighborsForecaster = R6::R6Class("NeighborsForecaster", } return ( data$getSerie(tdays[1])[predict_from:horizon] ) } - max_neighbs = 10 #TODO: 10 or 12 or... ? + max_neighbs = 12 #TODO: 10 or 12 or... ? if (length(tdays) > max_neighbs) { distances2 <- .computeDistsEndo(data, today, tdays, predict_from) diff --git a/pkg/R/plot.R b/pkg/R/plot.R index 8675c62..b5a8e4b 100644 --- a/pkg/R/plot.R +++ b/pkg/R/plot.R @@ -30,24 +30,24 @@ plotError <- function(err, cols=seq_along(err)) { if (!is.null(err$abs)) err = list(err) - par(mfrow=c(2,2), mar=c(4.7,5,1,1), cex.axis=1.5, cex.lab=1.5, lty=1) + par(mfrow=c(2,2), mar=c(4.7,5,1,1), cex.axis=1.5, cex.lab=1.5) L = length(err) yrange = range( sapply(1:L, function(i) ( err[[i]]$abs$day ) ), na.rm=TRUE ) matplot( sapply( seq_len(L), function(i) err[[i]]$abs$day ), type="l", - xlab="Time (hours)", ylab="Mean |y - y_hat|", ylim=yrange, col=cols, lwd=2 ) + xlab="Time (hours)", ylab="Mean |y - y_hat|", ylim=yrange, col=cols, lwd=2, lty=1 ) yrange = range( sapply(1:L, function(i) ( err[[i]]$abs$indices ) ), na.rm=TRUE ) matplot( sapply( seq_len(L), function(i) err[[i]]$abs$indices ), type="l", - xlab="Time (days)", ylab="Mean |y - y_hat|", ylim=yrange, col=cols, lwd=2 ) + xlab="Time (days)", ylab="Mean |y - y_hat|", ylim=yrange, col=cols, lwd=2, lty=1 ) yrange = range( sapply(1:L, function(i) ( err[[i]]$MAPE$day ) ), na.rm=TRUE ) matplot( sapply( seq_len(L), function(i) err[[i]]$MAPE$day ), type="l", - xlab="Time (hours)", ylab="Mean MAPE", ylim=yrange, col=cols, lwd=2 ) + xlab="Time (hours)", ylab="Mean MAPE", ylim=yrange, col=cols, lwd=2, lty=1 ) yrange = range( sapply(1:L, function(i) ( err[[i]]$MAPE$indices ) ), na.rm=TRUE ) matplot( sapply( seq_len(L), function(i) err[[i]]$MAPE$indices ), type="l", - xlab="Time (days)", ylab="Mean MAPE", ylim=yrange, col=cols, lwd=2 ) + xlab="Time (days)", ylab="Mean MAPE", ylim=yrange, col=cols, lwd=2, lty=1 ) } #' Plot measured / predicted