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()
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)