X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/predictops.git/blobdiff_plain/f04d85cc8028a2721d7d5e8ec866ff8022797bb5..ef7617a10d088cccaa6acd8b45a0db76bd8fb61e:/predictops/engine.py?ds=sidebyside diff --git a/predictops/engine.py b/predictops/engine.py index dedd265..f87e82e 100644 --- a/predictops/engine.py +++ b/predictops/engine.py @@ -7,6 +7,8 @@ from shutil import rmtree from .source.ephemeris import Ephemeris from .source.meteofrance import MeteoFrance +from .learn.learning import Learning +from .learn.preprocessing import Preprocessing from .target.target import Target fileConfig((Path.cwd() / 'config') / 'logging.cfg') @@ -71,6 +73,18 @@ class Engine: timestep = self._timestep) + def add_preprocessing(self): + self._preproc = Preprocessing(config_file = self._config, + dict_features = self.X, + dict_target = self.y) + + + def learn(self): + history = self._config['HISTORY_KNOWLEDGE'].getint('nb_lines') + self._learner = Learning(config_file = eval(self._config['LEARNER']['config']), + X = self._preproc.dataframe, y = list(self.y.values())[history:]) + + @property def X(self): return self._X