August 2019
Beginner
482 pages
12h 56m
English
Similar to how we built a REST API in Chapter 18, Serving Models with a RESTful API, let's start by serving median values from a JSON file. This will help us to set the model for working with Chalice:
import jsonwith open('./model.json', 'r') as f: model = json.load(f)
from chalice import Response@app.route('/predict/{complaint_type}', methods=['GET'])def predict(complaint_type:str) -> Response: