Skip to main content

Implementation of novel metrics for measuring inter-dataset similarity based on PCA.

Project description

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.

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')

# Calculate the values of the two metrics, namely Difference in Explained Variance and Angle Difference
result, _, _ = PCAMetric(df1, df2, 1)
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:

@inproceedings{rajabinasab2025interdatasetsimilarity,
  title={Metrics for Inter-Dataset Similarity with Example Applications in Synthetic Data and Feature Selection Evaluation},
  author={Rajabinasab, Muhammad and Lautrup, Anton D. and Zimek, Arthur},
  booktitle={Proceedings of the 2025 SIAM International Conference on Data Mining (SDM)},
  pages={TBD},
  year={2025},
  organization={SIAM}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pcametric-1.0.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pcametric-1.0.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file pcametric-1.0.1.tar.gz.

File metadata

  • Download URL: pcametric-1.0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for pcametric-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1284954b7036b8052222fc5fe337a88568768753b272a241e7e44a6e36f05e6c
MD5 f68b90f829481d92bbfcdbbab8ec7498
BLAKE2b-256 dfa553afa17628863767cc4dd676b696ffa8ae872e844ce844c063284efd99d4

See more details on using hashes here.

File details

Details for the file pcametric-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pcametric-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for pcametric-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 580d304cb48c8a34fb5064cec2cdee73cd642d7a658e18af4e210472d5d41954
MD5 5687b4626d2541b81b8d72a8c394c96b
BLAKE2b-256 725bb9f9f5b2350d8a1d967821b636c433b880b3c11f4f86dcee46bdf2854c16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page