def _test_ar_ga_with_predefined_lags(self, data, genome): loci = Enum('hindsight', 'AR_order') predictions = [] for period in self.periods: input_data = data[period:self.hindsight+period].copy() input_data['Load'][-self.prediction_steps:] = np.nan predictions.append( ar_ga_with_predefined_lags( input_data, genome, loci, self.prediction_steps)) target = self._get_target() rmse = calc_error(predictions, target, Oger.utils.rmse) return (predictions, target, rmse)
def _test_ar_data(self, data, lags_2d): predictions = [] for period in self.periods: input_data = data[period:self.hindsight+period].copy() input_data['Load'][-self.prediction_steps:] = np.nan prediction, _ = ar(input_data.values, lags_2d, self.prediction_steps, out_cols=[input_data.columns.tolist().index('Load')]) prediction = pd.Series( prediction[:,0], index=input_data.index[-self.prediction_steps:]) predictions.append(prediction) target = self._get_target(data) rmse = calc_error(predictions, target['Load'], Oger.utils.rmse) return (predictions, target, rmse)