ium_452662/predict.ipynb

1.7 KiB

import tensorflow as tf
import pandas as pd
import numpy as np
import sklearn
import sklearn.model_selection
from tensorflow.keras.models import load_model

feature_cols = ['year', 'mileage', 'vol_engine']

model = load_model('model.h5')
test_data = pd.read_csv('test.csv')

predictions = model.predict(test_data[feature_cols])
predicted_prices = [p[0] for p in predictions]


results = pd.DataFrame({'id': test_data['id'], 'year': test_data['year'], 'mileage': test_data['mileage'], 'vol_engine': test_data['vol_engine'], 'predicted_price': predicted_prices})
results.to_csv('predictions.csv', index=False)
2949/2949 [==============================] - 1s 462us/step