Spaces:
Sleeping
Sleeping
| # utils.py (Helper Functions) | |
| import joblib | |
| def load_model(): | |
| """ | |
| Loads the trained model from file. | |
| """ | |
| model = joblib.load("models/clf_svm.joblib") | |
| return model | |
| def model_predict(features): | |
| """ | |
| Predicts using the loaded model. | |
| """ | |
| model = load_model() | |
| prediction = model.predict([features]) # Fixed: Changed email to features | |
| # prediction = 1 if prediction == 1 else -1 | |
| return prediction |