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

Private GIT Repository
Refactoring, fin du lever/coucher de soleil, et début de sentinelles
[predictops.git] / predictops / learn / learning.py
index fb3675d56d7e007c557d93aeedd64bcc514a8df0..f13c3a6514eb2a8b552a4aa80fd13b275f590036 100644 (file)
@@ -32,10 +32,6 @@ class Learning:
         else:
             self._X = X
             self._y = y
-        rep = (Path.cwd() / self._file_name)
-        rep.mkdir()
-        self._filename = str(self._file_name / os.path.basename(self._file_name))
-        self._X.to_csv(self._filename + '.csv')
         self._learn()
         self._evaluate()
 
@@ -92,6 +88,10 @@ class Learning:
         for k in range(10):
             txt += f"Percentage of errors lower than {k}: {[abs(int(u-v))<=k for u,v in zip(self._y_test.values, y_test_pred)].count(True)/len(self._y_test)*100}\n"
 
+        rep = (Path.cwd() / self._file_name)
+        rep.mkdir()
+        self._filename = str(self._file_name / os.path.basename(self._file_name))
+
         print(txt)
         with open(self._filename + ".result", 'w') as f:
             f.write(txt)