mnist-logistic / inference.py
quantumbit's picture
Create inference.py
69fd4ce verified
raw
history blame contribute delete
331 Bytes
import joblib
import numpy as np
class Model:
def __init__(self):
self.model = joblib.load("mnist_logistic_regression.pkl") # Change for logistic and RF
def predict(self, inputs):
inputs = np.array(inputs).reshape(1, -1)
digit = self.model.predict(inputs)[0]
return {"digit": int(digit)}