moro23's picture
Update app.py
4bda0bc
raw
history blame contribute delete
No virus
486 Bytes
import pickle
import numpy as np
##
#Loading the pre-trained model and the tokenizer
#model_name = 'moro23/used-phones-price-prediction'
def predict_single(customer, dv, model):
X = dv.transform([customer])
y_pred = model.predict(X)
return y_pred[0]
with open('price-prediction-model.bin', 'rb') as f_in:
dv, model = pickle.load(f_in)
used_phone_sample = {
}
prediction = predict_single(used_phone_sample, dv, model)
print(f'prediction: {round(prediction,2)}')