| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This tutorial is built from the original feast-aws-credit-scoring-tutorial.
This tutorial demonstrates the use of Feast as part of a real-time credit scoring application.
To get a better feel of what this example entails, you can view the steps outlined below in notebook form in demo_walkthrough.ipynb.
You can setup the storages with Podman or Docker:
podman pull redis:7.4.5 podman run -d -p 6379:6379 --name redis -e "ALLOW_EMPTY_PASSWORD=yes" docker.io/library/redis:7.4.5
Install Feast using uv
uv sync
We have already set up a feature repository in feature_repo/. As a result, all we have to do is configure the feature_store.yaml/ in the feature repository. Please set the connection string of the Postgresql and Redis according to your local infra setup.
Deploy the feature store by running apply from within the feature_repo/ folder
cd feature_repo/ feast apply
Next we load features into the online store using the materialize-incremental command. This command will load the latest feature values from a data source into the online store.
CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%S") feast materialize-incremental $CURRENT_TIME
Alternatively, you may have to run
CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%S") feast materialize 1990-01-01T00:00:00 $CURRENT_TIME
Return to the root of the repository
cd ..
Finally, we train the model using a combination of loan data from the parque file under the ./data folder and our zipcode and credit history features from duckdb (with Filesource). And then we test online inference by reading those same features from Redis.
python run.py
The script should then output the result of a single loan application
loan rejected!
You can run
python app.pyAnd you'll be able to see the endpoints by going to http://127.0.0.1:8888/docs#/.
Current the Go Feature Server only supports "file", AWS "s3" and GCP "gs" storage. In this demo, we choose "file". Steps:
curl -X POST \
"http://localhost:8080/get-online-features" \
-d '{
"features": [
"zipcode_features:city",
"zipcode_features:state",
"zipcode_features:location_type",
"zipcode_features:tax_returns_filed",
"zipcode_features:population",
"zipcode_features:total_wages",
"credit_history:credit_card_due",
"credit_history:mortgage_due",
"credit_history:student_loan_due",
"credit_history:vehicle_loan_due",
"credit_history:hard_pulls",
"credit_history:missed_payments_2y",
"credit_history:missed_payments_1y",
"credit_history:missed_payments_6m",
"credit_history:bankruptcies",
"total_debt_calc:total_debt_due"
],
"entities": {
"dob_ssn": [
"19630621_4278"
],
"zipcode": [
76104
],
"loan_amnt": [
35000
]
}
}' | jq
Example returned feature values:
{
"metadata": {
"feature_names": [
"dob_ssn",
"zipcode",
"city",
"state",
"location_type",
"tax_returns_filed",
"population",
"total_wages",
"credit_card_due",
"mortgage_due",
"student_loan_due",
"vehicle_loan_due",
"hard_pulls",
"missed_payments_2y",
"missed_payments_1y",
"missed_payments_6m",
"bankruptcies",
"total_debt_due"
]
},
"results": [
{
"values": [
"19630621_4278"
]
},
{
"values": [
76104
]
},
{
"values": [
"FORT WORTH"
]
},
{
"values": [
"TX"
]
},
{
"values": [
"PRIMARY"
]
},
{
"values": [
6058
]
},
{
"values": [
10534
]
},
{
"values": [
142325465
]
},
{
"values": [
null
]
},
{
"values": [
null
]
},
{
"values": [
null
]
},
{
"values": [
null
]
},
{
"values": [
null
]
},
{
"values": [
null
]
},
{
"values": [
null
]
},
{
"values": [
null
]
},
{
"values": [
null
]
},
{
"values": [
null
]
}
]
}
| Back | FazBrowse Home | New Git URL |