FatimahAlzahrani's picture
Finish
fee0811
Raw
History Blame Contribute Delete
259 Bytes
import joblib
import numpy as np
model = joblib.load('titanic_model.pkl')
# Define inference function
def predict(features):
features_array = np.array(features).reshape(1, -1)
prediction = model.predict(features_array)
return int(prediction[0])