- Clone this repository.
- Build the docker image:
docker build -t fraud-model .
- Run the docker container, exposting port 5000:
docker run -d -p 5000:5000 fraud-model
- Invoke the model using curl/any other REST client:
curl --location --request POST 'http://localhost:5000/predict' --header 'Content-Type: application/json' --data-raw '{ "category": "travel", "amt": 300, "lat": 40.1362, "lon": -95.2138, "merch_lat": 40.591103, "merch_lon": -94.445245, "age": 70, "hour": 17, "day": 6, "month": 7 }'
xgboost model trained using the Credit Card Fraud Detection dataset.
Dataset imbalanced is tackled using SMOTE.
Precision: 0.93 Recall: 0.8
{
"category": category*,
"amt": float,
"lat": float,
"lon": float,
"merch_lat": float,
"merch_lon": float,
"age": int,
"hour": int,
"day": int,
"month": int
}
where category* refers to any categories below:
['grocery_pos', 'entertainment', 'shopping_pos', 'misc_pos', 'shopping_net', 'gas_transport', 'misc_net', 'grocery_net', 'food_dining', 'health_fitness', 'kids_pets', 'home', 'personal_care', 'travel']
Probability of whether a single transcation is a fraud transaction