+ dated_features = ramadan.dated_features
+ for date in dated_features:
+ self._X.setdefault(date, {}).update(dated_features[date])
+
+ def add_target(self):
+ config_file = eval(self._config['TARGET']['config'])
+ cumulative = self._config['TARGET'].getboolean('cumulative')
+ with open(config_file) as f:
+ self._config_text += f"{'='*10} {os.path.basename(config_file)} {'='*10}\n\n"
+ self._config_text += f.read() + '\n\n'
+
+ self._target = Target(config_file=config_file,
+ start=self._start, end=self._end,
+ timestep=self._timestep, cumulative=cumulative)
+
+ def add_preprocessing(self):
+ self._preproc = Preprocessing(config_file=self._config,
+ start=self._start, end=self._end,
+ timestep=self._timestep,
+ dict_features=self.X,
+ dict_target=self.y)
+
+ def learn(self):
+ config_file = eval(self._config['LEARNER']['config'])
+ with open(config_file) as f:
+ self._config_text += f"{'='*10} {os.path.basename(config_file)} {'='*10}\n\n"
+ self._config_text += f.read() + '\n\n'
+
+ history = eval(self._config['HISTORY_KNOWLEDGE']['nb_lines'])
+ self._learner = Learning(config_file=config_file, file_name=self._file_name,
+ X=self._preproc.dataframe, y=list(self.y.values())[history:],
+ horizon=self._config['TARGET'].getint('horizon'))