out.tsv denormalized

This commit is contained in:
Karolina Oparczyk 2021-05-17 18:13:50 +02:00
parent 916bb37c66
commit a8a249287f
2 changed files with 1007 additions and 1007 deletions

File diff suppressed because it is too large Load Diff

14
main.py
View File

@ -32,20 +32,20 @@ testA = (testA[['year', 'mileage', 'engineCapacity']] - min_val) / (max_val - mi
predicted_dev0 = model.predict(dev0[['year', 'mileage', 'engineCapacity']])
predicted_testA = model.predict(testA[['year', 'mileage', 'engineCapacity']])
predicted_denormalized = []
for pred in predicted_dev0:
denorm = pred[0] * (max_val[0] - min_val[0]) + min_val[0]
predicted_denormalized.append(denorm)
with open("dev-0/out.tsv", "w") as file:
for pred in predicted_dev0:
file.write(str(pred[0]) + "\n")
for pred in predicted_denormalized:
file.write(str(pred) + "\n")
with open("test-A/out.tsv", "w") as file:
for pred in predicted_testA:
file.write(str(pred[0]) + "\n")
predicted_denormalized = []
for pred in predicted_dev0:
denorm = pred[0] * (max_val[0] - min_val[0]) + min_val[0]
predicted_denormalized.append(denorm)
predicted_denormalized = DataFrame(predicted_denormalized, columns=['pred'])
error = mean_squared_error(expected, predicted_denormalized)
for exp, pred in zip(expected.values, predicted_denormalized.values):