File size: 486 Bytes
183f9aa
 
 
570bc68
4bda0bc
570bc68
4195304
570bc68
183f9aa
 
 
 
 
4195304
183f9aa
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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)}')