X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/predictops.git/blobdiff_plain/2c5695839a5064f584ffeaba557020ab3270b7b9..83fdad7cdd97734f036d464acceebaf3b0f0a44b:/main.py?ds=inline diff --git a/main.py b/main.py index 9e35b2d..d451534 100644 --- a/main.py +++ b/main.py @@ -1,13 +1,9 @@ from predictops.engine import Engine -from predictops.learn.preprocessing import Preprocessing -from predictops.target.all import All -from predictops.target.toarea import ToArea from logging import getLogger from logging.config import fileConfig from pathlib import Path -import geopandas as gpd fileConfig((Path.cwd() / 'config') / 'logging.cfg') logger = getLogger() @@ -15,27 +11,17 @@ logger = getLogger() if __name__ == '__main__': config = (Path.cwd() / 'config') / 'learn.cfg' - engine = Engine(config_file = config) + with Engine(config_file = config) as e: + e.add_features() + e.add_target() + e.add_preprocessing() + e.learn() - engine.add_features() - #print(engine.X) - process = Preprocessing(config_file = config, dict_features = engine.X) - - - #print(engine.X[datetime.strptime('06/30/2010 21:00:00', '%m/%d/%Y %H:%M:%S')]) - print(process.dataframe.head(n=20)) - print(process.dataframe.tail(n=20)) - - - target = All(stream_file = Path.cwd() / 'data' / 'targets' / 'sdis25' / 'interventions.csv') - - - exit() + '''target = toarea(stream_file = Path.cwd() / 'data' / 'targets' / 'sdis25' / 'interventions.csv') depts = gpd.read_file( Path.cwd() / 'data' / 'targets' / 'departments' / "departements-20180101.shp") Doubs = depts.loc[depts['nom'] == 'Doubs'].iloc[0] ToArea(area=Doubs.geometry, - start = start, end = end, csv_file = Path.cwd() / 'data' / 'targets' / 'sdis25' / 'interventions.csv') - + '''