]> AND Private Git Repository - predictops.git/blobdiff - predictops/learn/preprocessing.py
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Starting to investigate the fact that qualitative features with NaN
[predictops.git] / predictops / learn / preprocessing.py
index a878a8215d83e8cd504ff7f345cbd1c15165a7e7..49d7ef89bc2b2644f34f2022c3ee53d9827db98f 100644 (file)
@@ -48,14 +48,14 @@ class Preprocessing:
         else:
             self._features = set(chain.from_iterable([tuple(u.keys())
                                                       for u in [*dict_features.values()]]))
         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}
         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()
 
         print(self._features)
         exit()