Skip to main content

pypi downloads license python

Kolmogorov–Arnold Networks for Tabular Data Synthesis

KAN_synth is an open-source Python package for generating high-fidelity synthetic tabular data using Kolmogorov–Arnold Networks (KANs). It extends the original CTGAN and TVAE models from the Synthetic Data Vault (SDV) by replacing their MLP-based architectures with KAN-based components.

This project was developed for research (undergraduate thesis) and practical evaluation of KAN-based generative models, particularly in comparison to traditional GANs and VAEs on tabular data synthesis tasks.

Overview

The KAN_synth repository is structured into several components:

Models (models/)

KAN-based generative models for tabular data:

  • KAN_CTGAN: Fully KAN-based implementation of CTGAN.
  • HYBRID_KAN_CTGAN: CTGAN with only the first layer replaced by KAN.
  • Disc_KAN_CTGAN: CTGAN with a KAN-based discriminator only.
  • Gen_KAN_CTGAN: CTGAN with a KAN-based generator only.
  • KAN_TVAE: Full KAN-based variant of TVAE.
  • HYBRID_KAN_TVAE: TVAE where one intermediate layer is replaced by a KAN block.

Evaluation Scripts (benchmarks/)

Non-reusable scripts developed to:

  • Train and evaluate each model on various datasets.
  • Measure similarity and ML utility.
  • Aggregate and visualize results.

Data Generation Scripts (data_gen/)

Standalone scripts for generating synthetic datasets using each model for internal benchmarking and experimentation purposes.

Utilities (utilities/)

Functions to compute:

  • Overall similarity between real and synthetic datasets
  • Model evaluation metrics (MAE, RMSE, R² for regression; Accuracy, F1, etc. for classification)
  • Visualizations of ML utility scores across models

Tests (test/)

Unit tests for model importability, synthetic generation routines, and ML pipeline sanity checks using pytest.

The full model descriptions can be found in the thesis work at: [Not yet published].

Installation

Once the package is published on PyPI, it can be installed via pip:

pip install KAN-synth

All required packages are listed in requirements.txt, and will be automatically installed when using:

pip install -r requirements.txt

Since these models are based on the original CTGAN and TVAE architectures, the same data preprocessing principles apply:

  • Continuous columns must be represented as floats.
  • Discrete columns must be represented as integers or strings.
  • The input dataset should not contain any missing values.

For additional details, refer to the original CTGAN repository: https://github.com/sdv-dev/CTGAN

Local Development Installation

if you'd like to install the package locally for development or experimentation:

git clone https://github.com/cris1618/KAN_synth.git
cd KAN_synth
pip install -e .

The -e flag installs the package in "editable" mode, meaning any changes you make to the code will immediately affect the installed version without needing to reinstall.

Usage Example

Here's a minimal working example to train a KAN-based synthesizer and generate synthetic tabular data using the KAN_CTGAN model.

from KAN_synth import KAN_CTGAN
import pandas as pd

# Load real tabular data (pandas DataFrame)
df = pd.read_csv("your_dataset.csv")

# Define the discrete columns (if any)
discrete_columns = ["column_a", "column_b"]  # Modify as needed

# Initialize the synthesizer
synthesizer = KAN_CTGAN(
    epochs=100, 
    verbose=True, 
    grid_size_gen=5,  
    spline_order_gen=3,
    grid_size_desc=5,
    spline_order_desc=3
)

# Train the model on your data
synthesizer.fit(df, discrete_columns)

# Sample 1000 synthetic rows
synthetic_data = synthesizer.sample(1000)

# Save or explore the results
synthetic_data.to_csv("synthetic_output.csv", index=False)

You can replace KAN_CTGAN with any of the other available models, such as:

  • HYBRID_KAN_CTGAN
  • Disc_KAN_CTGAN
  • Gen_KAN_CTGAN
  • KAN_TVAE
  • HYBRID_KAN_TVAE

Each supports similar training and sampling APIs compatible with the original CTGAN and TVAE interfaces.

Metadata

Release files for KAN-synth 0.1.2

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

Source distribution (sdist)

Source distribution for KAN-synth 0.1.2
File Size Uploaded
kan_synth-0.1.2.tar.gz 42.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for KAN-synth 0.1.2
File Interpreter ABI Platform
kan_synth-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 108.8 kB

Release files / kan_synth-0.1.2.tar.gz

Download URL kan_synth-0.1.2.tar.gz
Size 42.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b063913b714208e7f337c9e05865fd80b4270eff4ae75e08c254e8cf259bea1d
BLAKE2b-256 checksum
How to use checksums
d13f995cb444dca2c129727b4c19adfc989afceec9f7d4723926ae444c2b5cff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

Release files / kan_synth-0.1.2-py3-none-any.whl

Download URL kan_synth-0.1.2-py3-none-any.whl
Size 66.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d832d25866e9054485f0891034a77c5c551ab414ce39638ec3c14345150ec7cf
BLAKE2b-256 checksum
How to use checksums
389f51cdf921864c226b60fdd55adf2cd41efb7e081e83ab5d22b9b14d2a2e41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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