This repo shows how to build a simple microservice for predicting loan approval. The service uses Redis as a feature store for both consumer credit and geographically based census data.
The purpose of this service is to demonstrate how to build low-latency machine learning applications with Redis and RedisAI. The diagram of the service is shown below:
The service utilizes Redis as both a Feature Store and an inference Server through the utilization of RedisAI. This means that both machine learning features, and the XGBoost model in this demo are co-located in the same Redis instance.
With RedisAI, a single inference call can
- Process input arguments
- Collect and process features
- Execute the XGBoost model with the features as the input
- Return the result
To do this, a RedisAI DAG
(directed acyclic graph) is used to chain together
Torch
code, ONNX-converted XGBoost models, and redis commands.
Here is an example of the operations that are performed in the DAG.
To run the service, bring up the docker containers as follows
$ docker compose up
Once it's running, a Jupyter Lab server will start that contains two notebooks for
- Training the XGBoost model
- Deploying the inference system into RedisAI
Click (or copy-paste) the link to the jupyter lab in the docker logs to open it in a browser.