projects
/
talweg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
attempt to fix F_Neighbors2
[talweg.git]
/
pkg
/
R
/
F_Neighbors2.R
diff --git
a/pkg/R/F_Neighbors2.R
b/pkg/R/F_Neighbors2.R
index
60916b4
..
ee40f61
100644
(file)
--- a/
pkg/R/F_Neighbors2.R
+++ b/
pkg/R/F_Neighbors2.R
@@
-46,8
+46,7
@@
Neighbors2Forecaster = R6::R6Class("Neighbors2Forecaster",
if (!is.na(prediction[1]))
{
nb_jours = nb_jours + 1
if (!is.na(prediction[1]))
{
nb_jours = nb_jours + 1
- error = error +
- mean((data$getCenteredSerie(cv_days[i]+1)[1:horizon] - prediction)^2)
+ error = error + mean((data$getSerie(cv_days[i]+1)[1:horizon] - prediction)^2)
}
}
return (error / nb_jours)
}
}
return (error / nb_jours)
@@
-207,10
+206,11
@@
Neighbors2Forecaster = R6::R6Class("Neighbors2Forecaster",
prediction = rep(0, horizon)
for (i in seq_along(fdays))
prediction = rep(0, horizon)
for (i in seq_along(fdays))
- prediction = prediction + similarities[i] * data$get
Centered
Serie(fdays[i]+1)[1:horizon]
+ prediction = prediction + similarities[i] * data$getSerie(fdays[i]+1)[1:horizon]
if (final_call)
{
if (final_call)
{
+ prediction = prediction - mean(prediction) #predict centered serie (artificial...)
private$.params$weights <- similarities
private$.params$indices <- fdays
private$.params$window <-
private$.params$weights <- similarities
private$.params$indices <- fdays
private$.params$window <-