{"id":20113339,"url":"https://github.com/cloudacademy/fraud-detection","last_synced_at":"2025-09-09T08:43:14.545Z","repository":{"id":23597477,"uuid":"99213391","full_name":"cloudacademy/fraud-detection","owner":"cloudacademy","description":"Fraud Detection model build with Python (numpy, scipy, pandas, scikit-learn), based on anonymized credit card transactions. The dataset is publicly available here: https://clouda-labs-assets.s3-us-west-2.amazonaws.com/fraud-detection/creditcard.csv.zip","archived":false,"fork":false,"pushed_at":"2022-06-21T21:27:39.000Z","size":15,"stargazers_count":60,"open_issues_count":2,"forks_count":21,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-09T12:11:44.471Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudacademy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-03T09:07:49.000Z","updated_at":"2025-04-07T06:46:51.000Z","dependencies_parsed_at":"2022-09-01T11:10:21.647Z","dependency_job_id":null,"html_url":"https://github.com/cloudacademy/fraud-detection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudacademy%2Ffraud-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudacademy%2Ffraud-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudacademy%2Ffraud-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudacademy%2Ffraud-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudacademy","download_url":"https://codeload.github.com/cloudacademy/fraud-detection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252683361,"owners_count":21788022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T18:24:05.805Z","updated_at":"2025-05-06T12:30:29.036Z","avatar_url":"https://github.com/cloudacademy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fraud-detection\nFraud Detection model based on anonymized credit card transactions\n\n\n## Getting started\nIn order to set up a microservice exposing a fraud detection POST endpoint, follow these steps:\n\n1. get the code from the repository\n```\ngit clone https://github.com/cloudacademy/fraud-detection.git \n```\n2. [download the dataset](https://clouda-labs-assets.s3-us-west-2.amazonaws.com/fraud-detection/creditcard.csv.zip) that will be used to train a transaction classifier. Unzip it and put the content (creditcard.csv) under folder data\n\n3. create a virtual environment (named e.g. fraud-detection), activate it and retrieve all needed python packages\n```\npip install -r requirements-dev.txt\n```\nIn case you do not needed to launch tests associated to this repo you only need to\n```\npip install -r requirements.txt\n```\ninstead\n\n4. launch a training for the fraud detection model\n```\npython src/train.py \n```\nfrom the repo root. This will show information about the advancement of training, the parameters tried during parameter optimization and the quality metrics achieved for different cases. This step should end with a model.pickle file under folder models.\n\n5. launch the Flask app\n```\nexport FLASK_APP=src/flask_app.py\nflask run\n```\nAfter this, a POST endpoint is exposed at http://127.0.0.1:5000/. You can send an application/json body of the form\n```\n{\n    \"features\": [\n    \t[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],\n    \t[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]\n    ]\n}\n```\ni.e. the value of key \"features\" is a list of 30-floats-long lists, representing the values associated to the transaction.\nYou will be returned a JSON\n```\n{\n    \"scores\": [\n        0.0323602000089039, \n        0.00037634905230425804\n    ]\n}\n```\ni.e. one fraud probability per transaction list submitted\n\n6. if the requirements-dev were installed, you can launch tests for the microservice, via\n```\nnosetests\n```\nfrom the repo root\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudacademy%2Ffraud-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudacademy%2Ffraud-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudacademy%2Ffraud-detection/lists"}