{"id":35237904,"url":"https://github.com/fernandojunior/financial-fraud-detection","last_synced_at":"2026-04-02T01:29:15.496Z","repository":{"id":37613302,"uuid":"201852524","full_name":"fernandojunior/financial-fraud-detection","owner":"fernandojunior","description":"A Python lib for fraud detection in a financial context","archived":false,"fork":false,"pushed_at":"2024-10-15T18:45:24.000Z","size":48066,"stargazers_count":15,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-01-02T09:21:59.881Z","etag":null,"topics":["anomaly-detection","credit-card","data-science","finance","fraud-detection","machine-learning","outlier-detection","python"],"latest_commit_sha":null,"homepage":"https://zindi.africa/competitions/xente-fraud-detection-challenge/data","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fernandojunior.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":"2019-08-12T03:38:30.000Z","updated_at":"2025-05-16T00:15:37.000Z","dependencies_parsed_at":"2023-01-21T11:46:31.310Z","dependency_job_id":null,"html_url":"https://github.com/fernandojunior/financial-fraud-detection","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/fernandojunior/financial-fraud-detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandojunior%2Ffinancial-fraud-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandojunior%2Ffinancial-fraud-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandojunior%2Ffinancial-fraud-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandojunior%2Ffinancial-fraud-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fernandojunior","download_url":"https://codeload.github.com/fernandojunior/financial-fraud-detection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandojunior%2Ffinancial-fraud-detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:05:07.454Z","status":"ssl_error","status_checked_at":"2026-04-02T00:56:46.496Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["anomaly-detection","credit-card","data-science","finance","fraud-detection","machine-learning","outlier-detection","python"],"created_at":"2025-12-30T04:08:22.884Z","updated_at":"2026-04-02T01:29:15.487Z","avatar_url":"https://github.com/fernandojunior.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fraud Detection\n\u003e The objective of this machine learning model is detect fraudulent transactions in the financial services sector.\n\n\n## Stakeholders\n\u003e People involved in this project\n\n| Role                 | Responsibility         | Full name                | e-mail       |\n| -----                | ----------------       | -----------              | ---------    |\n| Data Scientist       | Scrum Master           | Fernando Felix | fernandofelix@copin.ufcg.edu.br   |\n| Data Scientist       | Author                 | Dunfrey P. Aragão | dunfrey@gmail.com   |\n| Data Scientist       | Author                 | Ítalo de Pontes Oliveira           | italodepontesoliveira93@gmail.com |\n\n\n## Usage\nClone the repository:\n```\ngit clone https://github.com/\u003c@github_username\u003e/fraud_detection.git\ncd fraud_detection\n```\n\n### Prerequisites\n\nWe have tested the library in Ubuntu 19.04, 18.04 and 16.04, but it should be easy to compile in other platforms.\n\n#### Python\n\nThe project was written in Python 3, and work with later as well.\nAlso, please read up the subsequent libraries that are used: [CatBoost](https://catboost.ai/), [Scikit Learn](https://scikit-learn.org/stable/), [PyOD](https://pyod.readthedocs.io/en/latest/), [Pandas](https://pandas.pydata.org/) and [PySpark](https://spark.apache.org/).\n\n#### Libraries\n\nPlease make sure that it has installed all the required dependencies. \nA list of items to be installed using pip install can be running as following:\n```\npip install -r requirements.txt\n```\n\n#### All Environment\n\u003e It is possible to use the file `install.sh` to install all requirements automatically. \n\nExecute the script on the shell:\n```\n$ chmod +x install.sh\n$ sudo ./install.sh\n```\n\n### Running\n\nThe project does not need user interaction of information in time execution.\nTo run the whole workflow of the project, it is possible by the following command:\n\n```\n$ python main.py run \\\n  --input_train_file ../data/xente_fraud_detection_train.csv \\\n  --input_test_file ../data/xente_fraud_detection_test.csv \\\n  --output_balanced_train_x_file ../data/balanced_train_x.csv \\\n  --output_balanced_train_y_file ../data/balanced_train_y.csv \\\n  --output_valid_x_file ../data/valid_x.csv \\\n  --output_valid_y_file ../data/valid_y.csv \\\n  --output_valid_result_file ../data/valid_result.csv \\\n  --output_test_result_file ../data/xente_output_final.txt\n```\n\n* **input_train_file** \u0026 **input_test_file**: train and test datasets available by [Zindi](https://zindi.africa/competitions/xente-fraud-detection-challenge/data).\n* **output_balanced_train_x_file** \u0026 **output_balanced_train_y_file**: 70% of the oversampled training dataset to work on the training step.\n* **output_valid_x_file** \u0026 **output_valid_y_file**: 30% of the training dataset saved on memory to be used in validation step.\n* **output_valid_result_file**: outcome from the classification model using validation data.\n* **output_test_result_file**: outcome from the classification model using test data.\n\n\nIf that interested in work just a specific step (train, validate, or test), it is possible by:\n```\npython \u003cmode\u003e \u003c--key\u003e \u003ckeywords\u003e\n```\n\n* **mode**: run, train, validate, and test\n* **--key**: input_train_file, \n       input_test_file, \n       output_balanced_train_x_file, \n       output_balanced_train_y_file, \n       output_valid_x_file, \n       output_valid_y_file, \n       output_valid_result_file, \n       output_test_result_file\n* **keywords**: file name in your choice\n\nFor example:\n```\n$ python main.py train \\\n  --input_train_file ../data/xente_fraud_detection_train.csv \\\n  --output_balanced_train_x_file ../data/balanced_train_x.csv \\\n  --output_balanced_train_y_file ../data/balanced_train_y.csv \\\n  --output_valid_x_file ../data/valid_x.csv \\\n  --output_valid_y_file ../data/valid_y.csv\n```\n\nThe following scripts want to have the files to use by the model and the model created to be successful. \nIn the test, it is necessary to have the outlier detectors trained. All of them can be made at the training step.\n\n```\n$ python main.py validate \\\n  --output_valid_x_file ../data/valid_x.csv \\\n  --output_valid_y_file ../data/valid_y.csv \\\n  --output_valid_result_file ../data/valid_result.csv\n```\n\n```\n$ python main.py test \\\n  --input_test_file ../data/xente_fraud_detection_test.csv \\\n  --output_test_result_file ../data/xente_output_final.txt\n```\n\n### Model Frequency\n\nThe entire process is running over 11'44\". To training and predict the outcomes by detector outliers, it happens over 2'42,\" and to train dataset oversampling happens over by 4'10\".\n\n## Evaluation\n\u003e On-line: the project is evaluated on top 70, over +2000 submissions.\n\nThe project has been evaluated by a Zindi online application, according to the F1 score value, which ranges from 0 (total failure) to 1 (perfect score). Hence, the closer score is to 1, the better is the model.\nThis project reviewed before the submission and respecting all criteria \"meet specifications\" in order to pass.\n\n\u003e Off-line: The project submitted off-line to validate success using the dataset has saved 44.2% of lost by fraud/genuine transaction.\n\n## Documentation\n\n* [project_specification.md](./docs/project_specification.md): gives a data-science oriented description of the project.\n\n* [Fraud Detection Presentation and Classification Model Solution](./docs/Fraud_Detection_in_Financial_Transactions.pdf)\n\n* [Overview Task and System Documentation](./docs/Desafio_sobre_Deteccao_Fraudes.pdf) **(Written in Portuguese)**\n\n\n#### Folder structure\n\u003eProject Folder Structure and Files\n\n* [data](./data/): contains data files generated and used by the classification model.\n* [docs](./docs/): contains documentation of the project\n* [fraud_detection](./fraud_detection/): main Python package with source of the model.\n* [jupyter-notebook](./jupyter-notebook/): contains jupyter notebooks evaluation and modeling experimentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffernandojunior%2Ffinancial-fraud-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffernandojunior%2Ffinancial-fraud-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffernandojunior%2Ffinancial-fraud-detection/lists"}