From 1364020f224917242e6e2a1c6b07d4bb091fd45f Mon Sep 17 00:00:00 2001 From: Zach Zhu Date: Thu, 14 Dec 2023 16:06:12 +0800 Subject: [PATCH] algo: make re use resource total instead of average as resource history input Signed-off-by: Zach Zhu --- .../portrait/horizontal/predictive/replicas_estimator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/algorithm/kapacity/portrait/horizontal/predictive/replicas_estimator.py b/algorithm/kapacity/portrait/horizontal/predictive/replicas_estimator.py index 43a7012..6170913 100644 --- a/algorithm/kapacity/portrait/horizontal/predictive/replicas_estimator.py +++ b/algorithm/kapacity/portrait/horizontal/predictive/replicas_estimator.py @@ -176,7 +176,7 @@ def train(self): x_train = df_sample[features + [self.replicas_col, self.time_col] + ['weekday', 'minute']].copy() x_train[features] = x_train[features].astype(float).div(x_train[self.replicas_col].values, axis=0) - y_train = df_sample[self.resource_col] + y_train = df_sample[self.resource_col].astype(float).div(x_train[self.replicas_col].values, axis=0) x_train_trans = x_train[features].values @@ -254,7 +254,7 @@ def test(self): x_test = df_sample[features + [self.replicas_col, self.time_col] + ['weekday', 'minute']].copy() x_test[features] = x_test[features].astype(float).div(x_test[self.replicas_col].values, axis=0) - y_test = df_sample[self.resource_col] + y_test = df_sample[self.resource_col].astype(float).div(x_test[self.replicas_col].values, axis=0) self.future_ture = y_test x_test_trans = x_test[features].values