Skip to main content

AFD measures

A collection of measures for Approximate Functional Dependencies in relational data. Additionally, this repository contains all artifacts to "Approximately Measuring Functional Dependencies: a Comparative Study".

Short description

In real-world research projects, we often encounter unknown relational (tabular) datasets. In order to process them efficiently, functional dependencies (FDs) give us structural insight into relational data, describing strong relationships between columns. Errors in real-world data let traditional FD detection techniques fail. Hence we consider approximate FDs (AFDs): FDs that approximately hold in relational data.

This repository contains the implemented measures as well as the all artifacts to "Approximately Measuring Functional Dependencies: a Comparative Study".

Overview

  • code: this directory holds the code used to generate the results in the paper
    • afd_measures: all Python source code relating to the implemented AFD measures
    • experiments: Jupyter notebooks containing the processing steps to generate the results, figures or tables in the paper
    • synthetic_data: all Python source code relating to the synthetic data generation process
  • data: the datasets used in the paper
    • rwd: manually annotated dataset of files found on the web (see data/ground_truth.csv)
    • rwd_e: datasets from rwd with errors introduced into them. Generated by the notebook code/experiments/create_rwd_e_dataset.ipynb.
    • syn_e: synthetic dataset generated focussing on errors. Generated by the notebook code/experiments/create_syn_e.ipynb
    • syn_u: synthetic dataset generated focussing on left-hand side uniqueness. Generated by the notebook code/experiments/create_syn_u.ipynb
    • syn_s: synthetic dataset generated focussing on right-hand side skewness. Generated by the notebook code/experiments/create_syn_s.ipynb
  • paper: A full version of the paper including all proofs.
  • results: results of applying the AFD measures to the datasets.

Installation (measure library)

This library can be found on PyPI: afd-measures. Install it using pip like this:

pip install afd-measures

Usage (measure library)

To apply one of the measures to your data, you will need a pandas DataFrame of your relation. Pandas will automatically installed as a dependency of afd-measures. You can start with this Python snippet to analyse your own data (a CSV file in this example):

import afd_measures
import pandas as pd

my_data = pd.read_csv("my_amazing_table.csv")
print(afd_measures.mu_plus(my_data, lhs="X", rhs="Y"))

Installation (experiments)

To revisit the experiments that we did, clone this repository and install all requirements with Poetry (preferred) or Conda.

Poetry

Install the requirements using poetry. Use the extra flag "experiments" to install all additional requirements for the experiments to work. This includes (amongst others) Jupyter Lab.

$ poetry install -E experiments
$ jupyter lab

Conda

Create a new environment from the conda_environment.yaml file, activate it and run Jupyter lab to investigate the code.

$ conda create -f conda_environment.yaml
$ jupyter lab

Dataset References

In addition to this repository, we made our benchmark also available on Zenodo: find it here

Metadata

Release files for afd-measures 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for afd-measures 1.0.0
File Size Uploaded Provenance
afd_measures-1.0.0.tar.gz 8.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for afd-measures 1.0.0
File Interpreter ABI Platform
afd_measures-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / afd_measures-1.0.0.tar.gz

Download URL afd_measures-1.0.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3b473a3eb4856ca126da322a2e5fec992a78d5803ec28ef432411409f43a6cc9
BLAKE2b-256 checksum
How to use checksums
eff26a2f268af398bf629e79f49e0ead4dd4757125744ed89c94c86bf10fdc64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.6 Linux/6.5.6-200.fc38.x86_64

Release files / afd_measures-1.0.0-py3-none-any.whl

Download URL afd_measures-1.0.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c18e35a2bbd58ff943f523ea5624e8e64f66d139b147f0578b53b6d54e3d956f
BLAKE2b-256 checksum
How to use checksums
60d238a304a2ce2a0a846100600411f068770d7c7234729c674a9e36884f6f74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.6 Linux/6.5.6-200.fc38.x86_64

Security for afd-measures 1.0.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page