X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/predictops.git/blobdiff_plain/90e69cb2125d4bae76a27b9c38defb4f70bf2ca6..refs/heads/master:/predictops/learn/learning.py diff --git a/predictops/learn/learning.py b/predictops/learn/learning.py index fb3675d..f13c3a6 100644 --- a/predictops/learn/learning.py +++ b/predictops/learn/learning.py @@ -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)