Recall & Review
beginner
What is the main purpose of using Flask in model serving?
Flask is used to create a simple web server that can receive data, run the machine learning model on it, and send back predictions as responses.
Click to reveal answer
beginner
Which HTTP method is commonly used to send data to a Flask API for prediction?
The POST method is commonly used because it allows sending data in the request body, which the model can use to make predictions.
Click to reveal answer
intermediate
In a Flask API for model serving, what is the role of the 'request' object?
The 'request' object holds the incoming data sent by the client, such as JSON or form data, which the API uses as input for the model.
Click to reveal answer
beginner
Why do we use 'jsonify' in Flask API responses?
'jsonify' converts Python data like dictionaries into JSON format, which is a standard way to send data over the web and easy for clients to understand.
Click to reveal answer
intermediate
What is a simple way to load a saved machine learning model in a Flask API?
You can load a saved model using libraries like 'pickle' or 'joblib' at the start of the Flask app, so it’s ready to make predictions when requests come in.
Click to reveal answer
Which Flask function is used to start the web server for model serving?
✗ Incorrect
The 'app.run()' function starts the Flask web server to listen for incoming requests.
What format should input data be in when sending it to a Flask API for prediction?
✗ Incorrect
JSON is the most common and easy-to-use format for sending structured data to APIs.
Which Python library is commonly used to save and load machine learning models for Flask APIs?
✗ Incorrect
'pickle' is used to serialize and deserialize Python objects like machine learning models.
What does the Flask 'route' decorator do in model serving?
✗ Incorrect
The 'route' decorator tells Flask which URL path should run the decorated function.
Why is it important to handle errors in a Flask API for model serving?
✗ Incorrect
Error handling helps users understand what went wrong and prevents the server from crashing.
Explain the steps to create a Flask API that serves a machine learning model.
Think about how data flows from client to model and back.
You got /6 concepts.
Describe how you would test a Flask API for model serving after building it.
Testing means sending data and checking responses carefully.
You got /5 concepts.