File size: 432 Bytes
07502c7
 
8c5de86
 
 
07502c7
 
8c5de86
07502c7
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# inference.py

import joblib
import numpy as np

# Load your model (no scaler)
model = joblib.load('classification_model.joblib')

def predict(input_features):
    # Make sure the input is a 2D array (batch_size, num_features)
    input_array = np.array(input_features).reshape(1, -1)
    prediction = model.predict(input_array)
    return prediction.tolist()  # Return the prediction as a list for easy JSON handling