Use abs for scaling y

This commit is contained in:
bl 2017-07-03 21:29:38 -07:00
parent 4f9e0af51e
commit 3ebedb1110
2 changed files with 2 additions and 2 deletions

View file

@ -226,7 +226,7 @@ setup_dataframe <- function(m, df, initialize_scales = FALSE) {
dplyr::arrange(ds)
if (initialize_scales) {
m$y.scale <- max(df$y)
m$y.scale <- max(abs(df$y))
m$start <- min(df$ds)
m$t.scale <- as.numeric(max(df$ds) - m$start)
}

View file

@ -179,7 +179,7 @@ class Prophet(object):
df.reset_index(inplace=True, drop=True)
if initialize_scales:
self.y_scale = df['y'].max()
self.y_scale = df['y'].abs().max()
self.start = df['ds'].min()
self.t_scale = df['ds'].max() - self.start