Inter-Dataset Similarity Metric Based on PCA
This document presents the implementation of two novel metrics for measuring inter-dataset similarity based on PCA. These metrics are proposed in our paper, "Metrics for Inter-Dataset Similarity with Example Applications in Synthetic Data and Feature Selection Evaluation". This paper has been accepted to the 2025 SIAM International Conference on Data Mining (SDM).
Jupyter notebooks are provided for the experiments presented in the paper. You can run the code to reproduce the results.
| Notebook | Description |
|---|---|
| Pre-Investigation | Investigation of general properties of the new metrics |
| Use Case 1 | Examples from the paper for evaluation of synthetic tabular data |
| - Figure 3 | Codebook in different repository due to licensing |
| - Figure 4 | Codebook in different repository to avoid duplicate information |
| Use Case 2 | Experiments from the paper on feature selection evaluation |
Installation
You can install the package using pip:
pip install pcametric
Usage
Below is an example of how to use the metrics:
from pcametric import PCAMetric
import pandas as pd
# Loading the datasets
df1 = pd.read_csv('df1.csv')
df2 = pd.read_csv('df2.csv')
# Setting parameters
num_components = 1
normalization = "precise"
preprocess = "std"
# Calculate the values of the two metrics, namely Difference in Explained Variance and Angle Difference
result, _, _ = PCAMetric(df1, df2, num_components, normalization, preprocess)
edv, ad = result['exp_var_diff'], result['comp_angle_diff']
The Average Angle Difference (AAD) metric is also implemented and can be used as a model-agnostic approach for evaluating the performance of feature selection:
from pcametric import AAD
import pandas as pd
# Loading the dataset
df = pd.read_csv('df.csv')
#Index of selected features
selected_features = [2, 5, 11, 17, 22, 31, 40]
# Calculate AAD
aad = AAD(df, selected_features)
It is noteworthy that for all the metrics above, a lower value indicates greater similarity to the actual data.
Citation
If you use our metrics in your research, please cite the original paper:
@inbook{doi:10.1137/1.9781611978520.57,
author = {Muhammad Rajabinasab and Anton Lautrup and Arthur Zimek},
title = {Metrics for Inter-Dataset Similarity with Example Applications in Synthetic Data and Feature Selection Evaluation},
booktitle = {Proceedings of the 2025 SIAM International Conference on Data Mining (SDM)},
chapter = {},
pages = {527-537},
doi = {10.1137/1.9781611978520.57},
URL = {https://epubs.siam.org/doi/abs/10.1137/1.9781611978520.57},
eprint = {https://epubs.siam.org/doi/pdf/10.1137/1.9781611978520.57},
}
Metadata
Release files for pcametric 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pcametric-1.2.0.tar.gz | 4.9 kB | Without provenance | Details for pcametric-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pcametric-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for pcametric-1.2.0-py3-none-any.whl |
Total release size: 9.7 kB
Release files / pcametric-1.2.0.tar.gz
| Download URL | pcametric-1.2.0.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d34c80c5ad821c919fa49d24ca4adecdc942a18b70fa136c1e1744f98ab09458
|
|
BLAKE2b-256 checksum How to use checksums |
07641db66eb845aedba48599a64a80785f79d04df7a4b29e88d2fda5f8b97681
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / pcametric-1.2.0-py3-none-any.whl
| Download URL | pcametric-1.2.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2032ed78b9341f1985d484c1e6b800a0129a0915d9fbc3ff5e796b8ea7524d1d
|
|
BLAKE2b-256 checksum How to use checksums |
63fd1ef43f827a52abc11da3994b2a6356a1245c4fef3d1345b296aec728bd77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Security for pcametric 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.