## Introduction

This is the code of ICD3 (Learning Unbiased Cluster Descriptors for Interpretable Imbalanced Concept Drift Detection)

Authors: Yiqun Zhang, Zhanpei Huang, Mingjie Zhao, Chuyao Zhang, Yang Lu, Yuzhu Ji, Fangqing Gu, and An Zeng

Contact: 2112405010@mail2.gdut.edu.cn

## Datasets

`2D_2G_M` and `Avila` can be found in the `Datasets` folder. Each datasets contains `data_train.csv` as the base chunk. `data_w0_i.csv` denotes the incoming chunk that follows the same distribution as the base chunk, while `data_w1_i.csv` refers to the incoming chunk that follows a different distribution, with `i` representing the chunk index, ranging from 1 to 250. The subclusters, prototypes, and fusion queues learned for each dataset are saved in the `mat_file` folder.


## Code information

Density-Guided Concept Distribution Learning (DCDL) is written in MATLAB 2022a, while Concept Drift Detection is written in Python 3.11.7. Each section serves the following purpose:

The script information in the `Density-Guided_Concept_Distribution_Learning` folder is as follows:

- The `initial_seedPoints.m` initializes prototypes.
- The `density_gap.m` calculates the density gap for the samples.
- The `pns.m` calculates the true number of clusters.
- The `global_measures.m` calculate the global separability and global compactness.
- The `one_dim_gm_pdf.m` contains a 1-d Gaussian Mixture Probability Density Function.
- The `sgms.m` calculates subcluster grouping with model selection.
- The `show_result.m` saves the prototypes and fusion queues.

The `main_DCDL.m` file executes the entire DCDL algorithm on the provided dataset; The subclusters, prototypes, and fusion queues are saved to be necessary for subsequent analysis.

The `Drift_Detection.py` contains One-Cluster Classifier Learning (OCCL) and Concept Drift Detection using the previously learned prototypes and fusion queues to detect Concept Drift.


## How to use

The method is used for a two-step process:
Step 1: Density-Guided Concept Distribution Learning (DCDL) in MATLAB.

- Ensure that the `Density-Guided_Concept_Distribution_Learning` folder has been added to the execution path by right-clicking the folder, selecting `Add to Path`, and then left-clicking `Selected Folders and Subfolders`.
- Run the  `main_DCDL.m` to perform Density-Guided Concept Distribution Learning (DCDL) on the base chunk. This step learned the subclusters, prototypes, and fusion queues necessary for subsequent analysis.

Step 2: Concept Drift Detection in Python.

- Run `Drift_Detection.py` to detect Concept Drift based on previously learned prototypes and fusion queues.


## Paper

Please cite the paper if the codes are helpful for your research.

Yiqun Zhang, Zhanpei Huang, Mingjie Zhao, Chuyao Zhang, Yang Lu, Yuzhu Ji, Fangqing Gu, and An Zeng, "Learning Unbiased Cluster Descriptors for Interpretable Imbalanced Concept Drift Detection", _IEEE Transactions on Emerging Topics in Computational Intelligence (TETCI)_, DOI: 10.1109/TETCI.2025.3598327
	
