aboutsummaryrefslogtreecommitdiff
path: root/src/predict.py
blob: 329382abd1caf0dd88dcc12052c4ade6c6e557b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from model import Model

def predict_input(m):
    while True:
        try:
            x = int(input("Enter a mileage: "))
        except ValueError:
            print("Bad input, you should enter a number")
        else:
            break
    print("The predicted price for this mileage is", m.hypothesis(x))

if __name__ == "__main__":
    m = Model(thetafilename="./theta")
    predict_input(m)