Package: afd-measures
AFD measuresA 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 descriptionIn 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".Overviewcode: this directory holds the code used to generate the results in the paperafd_measures: all Python source code relating to the implemented AFD measuresexperiments: Jupyter notebooks containing the processing steps to generate the results, figures or tables in the papersynthetic_data: all Python source code relating to the synthetic data generation processdata: the datasets used in the paperrwd: manually annotated dataset of files found on the web (seedata/ground_truth.csv)rwd_e: datasets fromrwdwith errors introduced into them. Generated by the notebookcode/experiments/create_rwd_e_dataset.ipynb.syn_e: synthetic dataset generated focussing on errors. Generated by the notebookcode/experiments/create_syn_e.ipynbsyn_u: synthetic dataset generated focussing on left-hand side uniqueness. Generated by the notebookcode/experiments/create_syn_u.ipynbsyn_s: synthetic dataset generated focussing on right-hand side skewness. Generated by the notebookcode/experiments/create_syn_s.ipynbpaper: 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 onPyPI:afd-measures. Install it usingpiplike this:pipinstallafd-measuresUsage (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 ofafd-measures.
You can start with this Python snippet to analyse your own data (a CSV file in this example):importafd_measuresimportpandasaspdmy_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 withPoetry(preferred) orConda.PoetryInstall 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.$poetryinstall-Eexperiments
$jupyterlabCondaCreate a new environment from theconda_environment.yamlfile, activate it and run Jupyter lab to investigate the code.$condacreate-fconda_environment.yaml
$jupyterlabDataset ReferencesIn addition to this repository, we made our benchmark also available on Zenodo:find it hereadult.csv: Dua, D. and Graff, C. (2019).UCI Machine Learning Repository. Irvine, CA: University of California, School of Information and Computer Science.claims.csv: TSA Claims Data 2002 to 2006,published by the U.S. Department of Homeland Security.dblp10k.csv: Frequency-aware Similarity Measures. Lange, Dustin; Naumann, Felix (2011). 243–248.Made available as DBLP Dataset 2.hospital.csv: Hospital dataset used in Johann Birnick, Thomas Bläsius, Tobias Friedrich, Felix Naumann, Thorsten Papenbrock, and Martin Schirneck. 2020. Hitting set enumeration with partial information for unique column combination discovery. Proc. VLDB Endow. 13, 12 (August 2020), 2270–2283.https://doi.org/10.14778/3407790.3407824).Made available as part the dataset collection to that paper.t_biocase_...files: t_bioc_... files used in Johann Birnick, Thomas Bläsius, Tobias Friedrich, Felix Naumann, Thorsten Papenbrock, and Martin Schirneck. 2020. Hitting set enumeration with partial information for unique column combination discovery. Proc. VLDB Endow. 13, 12 (August 2020), 2270–2283.https://doi.org/10.14778/3407790.3407824).Made available as part the dataset collection to that paper.tax.csv: Tax dataset used in Johann Birnick, Thomas Bläsius, Tobias Friedrich, Felix Naumann, Thorsten Papenbrock, and Martin Schirneck. 2020. Hitting set enumeration with partial information for unique column combination discovery. Proc. VLDB Endow. 13, 12 (August 2020), 2270–2283.https://doi.org/10.14778/3407790.3407824).Made available as part the dataset collection to that paper.