With synthetic fraud samples produced by the GAN, the pipeline combines them with the original transaction data to create a balanced training set. Six diverse classifiers — spanning ensemble methods, kernel methods, instance-based learning, probabilistic models, and gradient boosting — are then trained on this augmented dataset so their results can be compared fairly under identical conditions.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Antisource/FFD/llms.txt
Use this file to discover all available pages before exploring further.
Combining Real and Synthetic Data
The GAN output (synthetic fraud transactions) is concatenated with the real fraud data from the original dataset. Alabel column encodes the source. Both the synthetic and real fraud DataFrames are combined, shuffled, and then their labels are encoded before training:
Train / Test Split
The combined and shuffled dataset is divided into training and test subsets using scikit-learn’strain_test_split. A fixed random_state guarantees reproducibility across all six models:
Training the Classifiers
Each of the six classifiers is trained on the same(x_train, y_train) split so that evaluation results are directly comparable. Explore the individual model pages for architecture details, hyperparameter choices, and per-model performance breakdowns:
Random Forest
An ensemble of decision trees that reduces variance through bagging and random feature subsampling.
SVM
Support Vector Machine with an RBF kernel that finds the maximum-margin hyperplane separating fraud from genuine transactions.
KNN
K-Nearest Neighbours classifies each test sample by majority vote among its K closest training points.
Naive Bayes
Gaussian Naive Bayes models each feature as an independent Gaussian distribution conditioned on the class label.
XGBoost
Extreme Gradient Boosting builds an additive ensemble of shallow trees with regularisation to prevent overfitting.
LightGBM
Light Gradient Boosting Machine uses histogram-based splits and leaf-wise growth for fast, memory-efficient training.
Why shuffle before training?After concatenation the dataset is ordered — all synthetic data comes first, followed by real fraud. Feeding this ordered array directly into
train_test_split would introduce ordering bias: the model could see only one class for long stretches, disrupting gradient updates in neural components and distorting cross-validation folds.Calling sample(frac=1) before splitting ensures that every mini-batch and every fold contains a representative mix of both classes, leading to more stable training and unbiased evaluation.