Skip to main content

A Python library for exploratory data analysis with advanced statistical features

Project description

EDASuite

A comprehensive Python library for exploratory data analysis with advanced features for data profiling, quality assessment, and stability monitoring.

Python 3.9+ License: MIT

Interactive Viewer

EDASuite includes a built-in interactive dashboard to explore your analysis results in the browser.

from edasuite.viewer.server import serve_results

# From a saved JSON file
serve_results("eda_results.json")

# Or directly from EDA results
results = runner.run(data=df, schema=schema, target_variable="target")
serve_results(results)

Summary — Dataset overview, insights, top features by IV, data quality score, and provider match rates.

Summary

Catalog — Sortable feature table with type, provider, target correlation, IV, and PSI at a glance.

Catalog

Deep Dive — Per-feature detail view with statistics, box plots, distribution charts, target associations, and correlations.

Deep Dive

Associations — Mixed-method heatmap (Pearson, Theil's U, Eta) showing relationships across all features.

Associations

Features

Core Analysis

  • Automated Feature Analysis
    • Continuous features: mean, median, std, quartiles, skewness, kurtosis, outliers
    • Categorical features: mode, value counts, cardinality, entropy
    • Automatic type inference with schema override support
    • Missing value detection and sentinel value replacement

Advanced Statistics

  • Target Relationship Analysis

    • Information Value (IV) and Weight of Evidence (WoE)
    • Optimal binning for continuous features
    • Predictive power classification
    • Statistical significance testing
  • Correlation & Association Analysis

    • Pearson and Spearman correlations with p-values
    • Theil's U (asymmetric categorical associations)
    • Eta / Correlation Ratio (categorical-continuous)
    • Unified association matrix across all feature types
    • Top-N correlation tracking per feature

Data Quality

  • Quality Assessment System

    • Automated quality scoring (0-10 scale)
    • Per-feature quality flags (high_missing, low_variance, constant, outliers)
    • Overall dataset quality metrics
    • Actionable recommendations
  • Sentinel Value Handling

    • Automatic detection and replacement of no-hit values
    • Provider-specific default value handling
    • Preserves integer dtypes using pandas nullable types (e.g. Int64) to avoid silent float upcasting
    • Configurable via DatasetSchema

Stability Monitoring

  • Cohort-Based Stability

    • PSI (Population Stability Index) for categorical features
    • KS (Kolmogorov-Smirnov) test for continuous features
    • Train/test drift detection
    • Feature-level stability metrics
  • Time-Based Stability

    • Multiple time window strategies (monthly, weekly, quartile, custom)
    • Temporal trend analysis (increasing, decreasing, volatile)
    • Auto-detection of optimal time periods
    • Minimum sample size enforcement

Provider Analytics

  • Provider Match Rates
    • Automatic detection via <provider>_record_not_found columns
    • Data coverage statistics by provider (% of records with data)
    • Feature-level availability tracking
    • Not-found record counts per provider
    • Supports both column-based and schema-based detection

Performance

  • Large Dataset Support
    • Multiple file format support (CSV, Parquet)
    • Chunked CSV reading for files >100MB
    • Configurable sampling for faster analysis
    • Memory-efficient correlation computation
    • Tested with 100K+ rows, 400+ features

Installation

pip install edasuite

Quick Start

Basic Usage

from edasuite import EDARunner, DataLoader
import pandas as pd

# Option 1: Load from file using DataLoader
df = DataLoader.load_csv("data.csv")

# Option 2: Use existing DataFrame
df = pd.read_csv("data.csv")  # or from database, etc.

# Initialize runner
runner = EDARunner(
    max_categories=50,
    top_correlations=10
)

# Run analysis
results = runner.run(
    data=df,
    output_path="eda_results.json"
)

Loading Data

EDASuite provides DataLoader utilities for loading data:

from edasuite import DataLoader

# Load CSV
df = DataLoader.load_csv("data.csv")

# Load Parquet (faster for large files)
df = DataLoader.load_parquet("data.parquet")

# Load with sampling
df = DataLoader.load_csv("large_file.csv", sample_size=10000)

With DatasetSchema

from edasuite import (
    EDARunner, DataLoader,
    ColumnConfig, ColumnType, ColumnRole, Sentinels, DatasetSchema,
)

# Load data and schema
df = DataLoader.load_csv("data.csv")
schema = DataLoader.load_schema("schema.json")

# Or create schema programmatically
schema = DatasetSchema([
    ColumnConfig('age', ColumnType.CONTINUOUS, ColumnRole.FEATURE,
                 provider='demographics', description='User age',
                 sentinels=Sentinels(not_found='-1')),
    ColumnConfig('zip_code', ColumnType.CATEGORICAL, ColumnRole.FEATURE,
                 provider='address', description='ZIP code',
                 sentinels=Sentinels(not_found='', missing='00000')),
    ColumnConfig('target', ColumnType.BINARY, ColumnRole.TARGET),
])

# Run with schema
runner = EDARunner()
results = runner.run(
    data=df,
    schema=schema,
    target_variable="target",
    output_path="eda_results.json"
)

Schema JSON format (schema.json):

{
  "columns": [
    {
      "name": "age",
      "type": "continuous",
      "role": "feature",
      "provider": "demographics",
      "description": "User age",
      "sentinels": {
        "not_found": "-1",
        "missing": null
      }
    }
  ]
}

Working with DataFrames

EDARunner works with pandas DataFrames, making it easy to integrate into existing data pipelines:

import pandas as pd
from edasuite import EDARunner

# From database
df = pd.read_sql("SELECT * FROM users", connection)

# From API
import requests
data = requests.get("https://api.example.com/data").json()
df = pd.DataFrame(data)

# In-memory transformations
df['age_group'] = pd.cut(df['age'], bins=[0, 30, 50, 100])

# Run EDA
runner = EDARunner()
results = runner.run(data=df, target_variable='target')

This is particularly useful for:

  • Working in Jupyter notebooks
  • Data loaded from databases (via pd.read_sql())
  • In-memory transformations without saving to disk
  • Integration with existing data pipelines

See examples/example_12_dataframe_input.py for more examples.

Stability Analysis

Cohort-Based (Train/Test)

from edasuite import EDARunner, DataLoader

# Load data and schema
df = DataLoader.load_parquet("data.parquet")
schema = DataLoader.load_schema("schema.json")

# Configure for stability analysis
runner = EDARunner(
    calculate_stability=True,
    cohort_column='dataTag',
    baseline_cohort='training',
    comparison_cohort='test'
)

results = runner.run(
    data=df,
    schema=schema
)

Time-Based

from edasuite import EDARunner, DataLoader

# Load data and schema
df = DataLoader.load_parquet("data.parquet")
schema = DataLoader.load_schema("schema.json")

# Configure for time-based stability
runner = EDARunner(
    time_based_stability=True,
    time_column='onboarding_time',
    time_window_strategy='monthly',  # or 'weekly', 'quartiles', 'custom'
    baseline_period='first',
    comparison_periods='all',
    min_samples_per_period=100
)

results = runner.run(
    data=df,
    schema=schema
)

DatasetSchema

DatasetSchema enables advanced functionality by defining column types, roles, providers, and sentinel values:

Variable Type Override

Override automatic type inference:

{
  "name": "customer_id",
  "type": "categorical",
  "role": "feature"
}

Sentinel Values

Define values that should be treated as missing:

{
  "name": "income",
  "type": "continuous",
  "role": "feature",
  "sentinels": {
    "not_found": "-1",
    "missing": "0"
  }
}

Provider Tracking

Track data sources:

{
  "name": "credit_score",
  "type": "continuous",
  "role": "feature",
  "provider": "bureau_provider",
  "description": "FICO credit score"
}

Output Format

EDASuite produces structured JSON output with three top-level sections:

metadata

  • Timestamp, execution time, version
  • Configuration (target variable, sampling, correlations)
  • Schema availability indicator

summary

  • Feature type distribution and counts
  • Data quality score with recommendations
  • Dataset info (rows, columns, memory, missing, duplicates)
  • Provider match rates (if schema with providers is used)
  • Feature counts across 16+ categories (see Feature Counts)
  • Association matrix (Pearson, Theil's U, Eta merged into a single N×N structure)
  • Top features by statistical score

features

List of per-feature analysis, each including:

  • Statistics (mean, median, mode, quartiles, etc.)
  • Distribution (histogram or value counts)
  • Missing values
  • Quality assessment
  • Correlations (with target and other features)
  • Target relationship (IV, WoE if target specified)
  • Stability (PSI/KS if enabled)

Provider Match Rates / Hit Rates

EDASuite automatically computes provider match rates (also called "hit rates") to help you understand data coverage from different third-party data providers.

Automatic Detection

Provider match rates are computed automatically during EDA using one of two methods:

Method 1: Using <provider>_record_not_found columns (Preferred)

If your dataset includes columns like payu_record_not_found, truecaller_record_not_found, etc., EDASuite will automatically detect and use them:

runner = EDARunner()
df = DataLoader.load_csv("data.csv")
results = runner.run(data=df)

# Access provider stats
provider_stats = results['summary']['provider_match_rates']

Method 2: Using DatasetSchema (Fallback)

If no record_not_found columns exist, you can use a schema to group features by provider:

df = DataLoader.load_csv("data.csv")
schema = DataLoader.load_schema("schema.json")

runner = EDARunner()
results = runner.run(data=df, schema=schema)

# Provider stats show match rates based on feature null analysis
provider_stats = results['summary']['provider_match_rates']

Example

See examples/example_10_provider_match_rates.py for a complete working example.

Feature Counts

EDASuite automatically computes feature counts across 16+ categories — useful for dashboards, feature selection, and data quality monitoring.

Automatic Computation

Feature counts are computed automatically during EDA and included in the results:

from edasuite import EDARunner, DataLoader

runner = EDARunner()
df = DataLoader.load_csv("data.csv")
results = runner.run(
    data=df,
    target_variable="target"  # Required for correlation and IV
)

# Access feature counts
feature_counts = results['summary']['feature_counts']

print(f"High Correlation: {feature_counts['high_correlation']['count']}")
print(f"Redundant Features: {feature_counts['redundant_features']['count']}")
print(f"High IV: {feature_counts['high_iv']['count']}")
print(f"High Stability: {feature_counts['high_stability']['count']}")

Categories

Target Relationship

Category Threshold Description
High Correlation best association > 0.1 Features associated with target (Pearson, Eta, or Theil's U)
High IV IV > 0.1 Features with strong predictive power
Significant Correlations p-value < 0.05 Statistically significant target correlations
Suspected Leakage IV > 0.5 Features with suspiciously high predictive power

Feature Quality

Category Threshold Description
Redundant Features correlation > 0.7 Highly correlated with another feature
High Missing > 30% Features with substantial missing values
Constant Features 1 unique value Zero-variance features
Low Variance low CV Features with very low coefficient of variation
Not Recommended composite Features flagged as unsuitable for modeling
Highly Skewed |skewness| > 1.0 Features with heavy distributional skew
High Kurtosis kurtosis > 3.0 Outlier-prone features
High Cardinality Categoricals with high unique-value ratio

Predictive Power Breakdown

Category Description
Predictive Power Count of features by IV class: unpredictive, weak, medium, strong, very strong

Stability

Category Threshold Description
High Stability PSI < 0.1 Stable distribution across cohorts/time
Minor Shift 0.1 ≤ PSI < 0.2 Minor distribution drift
Major Shift PSI ≥ 0.2 Major distribution drift
Increasing Drift Worsening distribution drift over time
Volatile Stability Inconsistent stability across periods

Example

See examples/example_11_feature_counts.py for a complete working example with UI formatting.

Advanced Configuration

Correlation Settings

runner = EDARunner(
    top_correlations=10,           # Top N correlations per feature
    max_correlation_features=500   # Limit features in correlation matrix
)

Sampling for Large Datasets

runner = EDARunner(
    sample_size=10000  # Analyze sample of 10K rows
)

Custom Column Selection

df = DataLoader.load_csv("data.csv")
results = runner.run(
    data=df,
    columns=['age', 'income', 'zip_code']  # Analyze specific columns
)

Compact JSON Output

df = DataLoader.load_csv("data.csv")
results = runner.run(
    data=df,
    output_path="results.json",
    compact_json=True  # Minimize JSON size
)

Parquet File Benefits

Parquet format offers significant advantages:

  • Faster loading: Columnar format with efficient compression
  • Smaller file size: Typically 50-80% smaller than CSV
  • Type preservation: Maintains data types (no type inference needed)
  • Column selection: Read only needed columns (reduces memory usage)
# Convert CSV to Parquet (one-time operation)
import pandas as pd
df = pd.read_csv("data.csv")
df.to_parquet("data.parquet", index=False)

# Then use Parquet for faster analysis
df = DataLoader.load_parquet("data.parquet")
runner = EDARunner()
results = runner.run(data=df)

Development

pip install -e .           # Install for development
python -m build            # Build package
python -m pytest tests/    # Run tests

Documentation

Requirements

  • Python 3.9+
  • pandas >= 2.0.0
  • numpy >= 1.24.0
  • scipy >= 1.10.0
  • pyarrow >= 10.0.0 (for Parquet support)

License

MIT License - see LICENSE file for details.

Contact

For questions or suggestions:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

edasuite-0.0.5.tar.gz (87.7 kB view details)

Uploaded Source

Built Distribution

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

edasuite-0.0.5-py3-none-any.whl (83.1 kB view details)

Uploaded Python 3

File details

Details for the file edasuite-0.0.5.tar.gz.

File metadata

  • Download URL: edasuite-0.0.5.tar.gz
  • Upload date:
  • Size: 87.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for edasuite-0.0.5.tar.gz
Algorithm Hash digest
SHA256 9e9a8597380fd1919e398cb0bf9097cae52ea0952d7c6b6fa9acf674a217ea6c
MD5 6dc119bff2239a5b703ce46a2329350f
BLAKE2b-256 70894978cd8643c23e979b895a98b2041077402dbdca64cb0e11231936cfcac5

See more details on using hashes here.

Provenance

The following attestation bundles were made for edasuite-0.0.5.tar.gz:

Publisher: publish.yml on lattiq/edasuite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file edasuite-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: edasuite-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 83.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for edasuite-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9b0928ef57692b6f9f3c0be2603b4aaa4215e7ff2b65a6c8d7cdfcadd72228ec
MD5 11a581af345845985b9b1b49848cdac9
BLAKE2b-256 a4c6a8191b340c3ec77cc83044f17ba40010de0f4fba26fbc7cac1c719b1cb6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for edasuite-0.0.5-py3-none-any.whl:

Publisher: publish.yml on lattiq/edasuite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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