Feature Selection-Driven Fraud Detection

A two-stage ML pipeline for financial fraud detection via Borda Count feature ranking, ML benchmarking, and SHAP analysis

您现在正在关注此提交

This repository provides a MATLAB implementation pipeline for data-driven financial fraud detection using raw accounting items rather than static ratios. It operates in two main stages: featureranking.m applies 5-fold cross-validation across five statistical feature selection methods (Correlation, Random Forest, LASSO, F-Score, and Mutual Information) to generate a stable hierarchy via Borda Count consensus aggregation, while testingMLalgorithm.m benchmarks eight machine learning classifiers using incremental feature subsets. By incorporating cost-sensitive learning to handle severe class imbalance, the framework evaluates models through a multi-objective Pareto efficiency analysis—identifying k-NN with 13 optimal features as the champion model—and automatically exports high-resolution 600 DPI evaluation figures alongside surrogate SHAP explainability plots.
Overview
This repository contains a complete, reproducible MATLAB pipeline designed to detect financial statement fraud in highly imbalanced datasets. Rather than relying on rigid, traditional financial ratios, this framework implements a data-driven approach using raw financial statement items derived from the Beneish M-Score model.
The pipeline is split into two distinct, sequential modules:
Feature Selection via Cross-Validation (featureranking.m): Evaluates 26 raw financial features using five diverse selection methods (Correlation, Random Forest, LASSO, F-Score, and Mutual Information) within a 5-fold stratified cross-validation framework, synthesizing the rankings via a robust Borda Count consensus aggregation.
Benchmark & Multi-Objective Efficiency Analysis (testingMLalgorithm.m): Incrementally tests eight machine learning paradigms (ranging from decision trees and linear models to ensemble and distance-based classifiers) using the consensus-ranked features, concluding with a Pareto efficiency evaluation and SHAP (Shapley Additive exPlanations) interpretability analysis.
Repository Structure & File Dependencies
To ensure seamless execution, make sure the following files are located in your MATLAB working directory:
Train.xlsx: The primary dataset containing company-year observations, where the first column represents the binary fraud label (0 for non-fraud, 1 for fraud) and the remaining columns represent the raw financial variables.
CV_Feature_Ranking_Results.xlsx: The intermediate output generated by the first script, which stores the consensus feature rankings.
featureranking.m: The feature selection script.
testingMLalgorithm.m: The machine learning benchmark, evaluation, and visualization script.
Step-by-Step Execution Guide
Step 1: Run Feature Selection (featureranking.m)
Execute the first script to perform the 5-fold cross-validation feature selection and rank aggregation:
Matlab
run('featureranking.m');
What it does: Prevents data leakage by computing Z-score normalization strictly on training folds, ranks features across five independent algorithms, aggregates them using Borda Count, and exports the master ranking to CV_Feature_Ranking_Results.xlsx.
Step 2: Run Benchmark & Model Optimization (testingMLalgorithm.m)
Once the ranking file is generated, execute the second script:
Matlab
run('testingMLalgorithm.m');
What it does: Dynamically loads the ranked features, iteratively trains eight classifiers via an incremental feature expansion loop (1 to 26 features), records performance metrics (F1-score, Precision, Recall, AUC, Confusion Matrix elements), calculates a multi-objective Pareto Efficiency Score, and exports high-resolution (600 DPI TIFF) academic charts along with a surrogate-based SHAP analysis.
Requirements
MATLAB (Tested on R2026a / compatible with recent releases).
Statistics and Machine Learning Toolbox.

引用格式

Utku Kaya (2026). Feature Selection-Driven Fraud Detection (https://ww2.mathworks.cn/matlabcentral/fileexchange/184605-feature-selection-driven-fraud-detection), MATLAB Central File Exchange. 检索时间: .

标签

添加标签

Add the first tag.

一般信息

MATLAB 版本兼容性

  • 兼容任何版本

平台兼容性

  • Windows
  • macOS
  • Linux
版本 已发布 发行说明 Action
1.0.0