mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-07-29 20:14:08 +00:00
Use abs for scaling y
This commit is contained in:
parent
4f9e0af51e
commit
3ebedb1110
2 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue