File size: 462 Bytes
6123868
729a348
6123868
 
729a348
6123868
729a348
6123868
 
729a348
6123868
 
 
 
 
 
 
 
 
 
729a348
6123868
 
729a348
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# app.py

from flask import Flask, request, jsonify
import joblib

app = Flask(__name__)

# Load trained model
model = joblib.load('model.pkl')

@app.route('/predict', methods=['POST'])
def predict():
    # Get input data
    data = request.json['data']
    
    # Make predictions
    predictions = model.predict(data)
    
    # Return predictions
    return jsonify({'predictions': predictions.tolist()})

if __name__ == '__main__':
    app.run(debug=True)