| 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]) | |
| 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]) | |