The project aims to develop a baseline fraud detection system to identify potentially fraudulent credit card transactions. Utilising supervised learning techniques, this project serves as a foundational model for understanding and addressing credit card fraud issues faced by financial institutions.
If you find this project useful, please consider giving it a star ⭐ on GitHub. Contributions are also welcome!
- Python: Programming language used for development.
- FastAPI: Framework for building the API.
- Scikit-learn: Machine learning library used for model training.
- Pandas: Data manipulation library.
- NumPy: Library for numerical operations.
- Joblib: Library for model serialisation.
To get a local copy of this project up and running, follow these steps:
- Clone the repository:
git clone https://github.com/nafisalawalidris/Fraud-Detection-with-Supervised-Learning.git
- Navigate to the project directory:
cd Fraud-Detection-with-Supervised-Learning
- Create a virtual environment:
python -m venv fraud_detection_env
- Activate the virtual environment:
- On Windows:
.\fraud_detection_env\Scripts\activate
- On macOS/Linux
source fraud_detection_env/bin/activate
- Install the required packages:
pip install -r requirements.txt
- Run the FastAPI server:
uvicorn main:app --reload
Then open your browser and go to http://localhost:8501.
- Send a POST request to the /predict endpoint with transaction data in the following format:
{
"Time": 123456,
"V1": 0.0,
"V2": 1.0,
...
"Amount": 100.00
}
- Receive a response with fraud prediction and probability:
{
"fraud_prediction": true,
"fraud_probability": 0.95
}
- Simple and effective fraud detection using supervised learning techniques.
- RESTful API built with FastAPI for easy integration.
- Detailed logging of predictions and transactions.
- Well-structured codebase that allows for easy modifications and enhancements.
Contributions are welcome, If you have suggestions for improvements or want to contribute to this project, please fork the repository and create a pull request.
Fork the repository.
Create a new feature branch (git checkout -b feature-name).
Commit your changes (git commit -m 'Add some feature').
Push to the branch (git push origin feature-name).
Open a pull request.
his project is licensed under the MIT License. See the LICENSE file for more information.
For any inquiries or feedback, please contact me at https://nafisalawalidris.github.io/13/.