]> AND Private Git Repository - predictops.git/blob - main.py
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
426d3b580fdbed6586b7111ce6ffb17c1172824a
[predictops.git] / main.py
1 from predictops.engine import Engine
2 from predictops.learn.preprocessing import Preprocessing
3 from predictops.target.toarea import ToArea
4
5 from logging import getLogger
6 from logging.config import fileConfig
7 from pathlib import Path
8
9 import geopandas as gpd
10
11 fileConfig((Path.cwd() / 'config') / 'logging.cfg')
12 logger = getLogger()
13
14 if __name__ == '__main__':
15
16     config = (Path.cwd() / 'config') / 'learn.cfg'
17     engine = Engine(config_file = config)
18
19     engine.add_features()
20     #print(engine.X)
21     process = Preprocessing(config_file = config, dict_features = engine.X)
22
23
24     #print(engine.X[datetime.strptime('06/30/2010 21:00:00', '%m/%d/%Y %H:%M:%S')])
25     print(process.dataframe.head(n=20))
26     print(process.dataframe.tail(n=20))
27     exit()
28
29     depts = gpd.read_file( Path.cwd() / 'data' / 'targets' / 'departments' / "departements-20180101.shp")
30     Doubs = depts.loc[depts['nom'] == 'Doubs'].iloc[0]
31
32     ToArea(area=Doubs.geometry,
33            start = start, end = end,
34            csv_file = Path.cwd() / 'data' / 'targets' / 'sdis25' / 'interventions.csv')
35