forked from kubapok/auta-public
out.tsv denormalized
This commit is contained in:
parent
916bb37c66
commit
a8a249287f
2000
dev-0/out.tsv
2000
dev-0/out.tsv
File diff suppressed because it is too large
Load Diff
14
main.py
14
main.py
@ -32,20 +32,20 @@ testA = (testA[['year', 'mileage', 'engineCapacity']] - min_val) / (max_val - mi
|
|||||||
predicted_dev0 = model.predict(dev0[['year', 'mileage', 'engineCapacity']])
|
predicted_dev0 = model.predict(dev0[['year', 'mileage', 'engineCapacity']])
|
||||||
predicted_testA = model.predict(testA[['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:
|
with open("dev-0/out.tsv", "w") as file:
|
||||||
for pred in predicted_dev0:
|
for pred in predicted_denormalized:
|
||||||
file.write(str(pred[0]) + "\n")
|
file.write(str(pred) + "\n")
|
||||||
|
|
||||||
with open("test-A/out.tsv", "w") as file:
|
with open("test-A/out.tsv", "w") as file:
|
||||||
for pred in predicted_testA:
|
for pred in predicted_testA:
|
||||||
file.write(str(pred[0]) + "\n")
|
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'])
|
predicted_denormalized = DataFrame(predicted_denormalized, columns=['pred'])
|
||||||
error = mean_squared_error(expected, predicted_denormalized)
|
error = mean_squared_error(expected, predicted_denormalized)
|
||||||
for exp, pred in zip(expected.values, predicted_denormalized.values):
|
for exp, pred in zip(expected.values, predicted_denormalized.values):
|
||||||
|
Loading…
Reference in New Issue
Block a user