The Tunisian Company of Electricity and Gas (STEG) is a public and a non-administrative company, it is responsible for delivering electricity and gas across Tunisia. The company suffered tremendous losses in the order of 200 million Tunisian Dinars due to fraudulent manipulations of meters by consumers.
# Fraud Detection in Electricity and Gas Consumption - STEG Tunisia
## Project Overview
This project implements a machine learning solution for detecting fraudulent behavior in electricity and gas consumption for STEG (Société Tunisienne de l'Electricité et du Gaz). The system analyzes client data and invoice patterns to identify potential cases of fraud.
## Problem Description
STEG faces challenges with fraudulent activities in electricity and gas consumption, which leads to significant revenue losses. This project aims to:
- Identify suspicious consumption patterns
- Detect potential fraud cases based on historical data
- Help STEG prioritize investigations of suspicious cases
## Data Description
The dataset consists of two main components:
### Training Data (`data/train/`)
- `client_train.csv`: Client information including:
- Client ID
- District
- Client category
- Region
- Creation date
- Target (fraud: 1, no fraud: 0)
- `invoice_train.csv`: Invoice details including:
- Consumption levels (1-4)
- Counter information
- Invoice dates
### Test Data (`data/test/`)
- Similar structure to training data but without the target variable
## Project Structure
```
├── data/
│ ├── train/
│ │ ├── client_train.csv
│ │ └── invoice_train.csv
│ ├── test/
│ │ ├── client_test.csv
│ │ └── invoice_test.csv
│ └── SampleSubmission.csv
├── models/
│ └── lightgbm_fraud_detection.joblib
├── notebook/
│ ├── fraud_detection.ipynb # Main notebook with EDA and model development
│ ├── fraud_detection.py # Python version of the notebook
│ └── predict.py # Streamlined script for training and prediction
├── requirements.txt
└── README.md
```
## Model Performance
The LightGBM model achieves:
- Accuracy: 94%
- ROC AUC Score: 0.769
- Precision for fraud detection: 38%
- Recall for fraud detection: 1%
## Setup and Installation
1. Clone the repository:
```bash
git clone
github.com …