Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 2.21 KB

README.md

File metadata and controls

67 lines (48 loc) · 2.21 KB


RedisAI    Code   


Loan Prediction Microservice

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:


drawing

Feature and Inference Serving

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

  1. Process input arguments
  2. Collect and process features
  3. Execute the XGBoost model with the features as the input
  4. 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.


drawing

Running the Service

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

  1. Training the XGBoost model
  2. 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.