X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/predictops.git/blobdiff_plain/2c5695839a5064f584ffeaba557020ab3270b7b9..4b6d71d96bb92791cc31640e5f30378ae6fe63e4:/predictops/learn/preprocessing.py?ds=inline diff --git a/predictops/learn/preprocessing.py b/predictops/learn/preprocessing.py index a878a82..49d7ef8 100644 --- a/predictops/learn/preprocessing.py +++ b/predictops/learn/preprocessing.py @@ -48,14 +48,14 @@ class Preprocessing: else: self._features = set(chain.from_iterable([tuple(u.keys()) for u in [*dict_features.values()]])) - for csv_file in listdir(): - with open(csv_file, "r") as f: - reader = DictReader(f, delimiter=',') - dico_features = {{row['name']: row['type'] # qualitative (2) or quantitative (1) - } - for row in reader if row['name'] in self._features} - + csv_files = Path.cwd() / 'config' / 'features' self._features = {feat : None for feat in self._features} + for csv_file in listdir(csv_files): + with open(csv_files / csv_file, "r") as f: + reader = DictReader(f, delimiter=',') + for row in reader: + if row['name'] in self._features: + self._features[row['name']] = row['type'] print(self._features) exit()