FraudDetection is a Python-based system for detecting fraudulent transactions in financial data. The system uses a combination of machine learning algorithms and data preprocessing techniques to identify potentially fraudulent transactions.
- Data Preprocessing: The system includes a data preprocessing module that handles missing values, encodes categorical variables, and normalises numerical features.
- Machine Learning Models: The system includes two machine learning models: a deep learning model (FraudDetectionModel) and a random forest model (FraudDetectionRFModel).
- Model Evaluation: The system includes a model evaluation module that calculates accuracy, precision, recall, and F1 score for each model.
- Model Saving and Loading: The system allows for saving and loading trained models for future use.
- Python: The system is built using Python 3.10.14.
- Libraries: The system requires the following libraries:
pandas
for data manipulation and analysisnumpy
for numerical computationstorch
for deep learningsklearn
for machine learningmatplotlib
andseaborn
for data visualisation
- Download the dataset (e.g.,
Fraud.csv
) and place it in theFraud_data
directory. - Preprocess the data using the
DataPreprocessing
module.
- Train the deep learning model using the
FraudDetectionModel
class. - Train the random forest model using the
FraudDetectionRFModel
class.
- Evaluate the performance of each model using the
ModelEvaluation
module.
- Save the trained models using the
ModelSaving
module. - Load the saved models using the
ModelLoading
module.
- Fraud Detection: Use the system to detect fraudulent transactions in a financial dataset.
- Model Comparison: Use the system to compare the performance of different machine learning models on a fraud detection task.
Contributions are welcome! If you would like to contribute to the FraudDetection system, please fork the repository and submit a pull request.
The FraudDetection system is released under the MIT License.