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