A lightweight, containerized Panel-based web application for assessing data quality in clinical medicine CSV files using TabPFN (Prior-Data Fitted Networks).
- TabPFN-Based Quality Assessment: Uses TabPFN's unsupervised learning capabilities for outlier detection, anomaly detection, and missing value pattern analysis
- Clinical Quality Checks: Validates clinical data for impossible values, temporal inconsistencies, referential integrity, and clinical plausibility
- Interactive Visualizations: Real-time quality metrics with pragmatic, understandable visualizations
- Comprehensive Scoring: Overall and component-level quality scores (0-100 scale)
- Actionable Recommendations: Provides specific recommendations for data quality improvements
- Lightweight Container: Easy deployment with Docker
# Build the container
docker build -t tabpfn-data-quality .
# Run the container
docker run -p 5006:5006 tabpfn-data-qualityThen open your browser to http://localhost:5006
For production deployments, you can use Docker Compose:
# Start the application
docker-compose -f docker-compose.prod.yml up -d
# View logs
docker-compose -f docker-compose.prod.yml logs -f
# Stop the application
docker-compose -f docker-compose.prod.yml downPre-built Docker images are automatically published to GitHub Container Registry (ghcr.io) on every push to the production branch.
Pull and run the latest image:
# Pull the latest image from GitHub Container Registry
docker pull ghcr.io/salkinii/tabpfn-testing:latest
# Run the container
docker run -p 5006:5006 ghcr.io/salkinii/tabpfn-testing:latestUsing Docker Compose with registry image:
The docker-compose.prod.yml file is configured to use the pre-built image from GitHub Container Registry. Simply run:
# Pull latest image and start
docker-compose -f docker-compose.prod.yml pull
docker-compose -f docker-compose.prod.yml up -dAvailable image tags:
latest- Latest production buildproduction- Production branch buildsv1.0.0,v1.1.0- Version tags (when created)production-<sha>- Specific commit builds
Note: If the repository is public, images are publicly accessible. If private, you'll need to authenticate:
# Authenticate with GitHub Container Registry
echo $GITHUB_TOKEN | docker login ghcr.io -u YOUR_USERNAME --password-stdinThe application supports the following environment variables:
HF_TOKEN: (Optional) Hugging Face token for TabPFN model access. If not provided, TabPFN will use statistical fallback methods.PYTHONUNBUFFERED: (Optional) Set to1for unbuffered Python output (useful for logging)
Important Security Note: The HF_TOKEN is never baked into Docker images. It must be provided at runtime via environment variables or .env file. This ensures your token remains secure and is never exposed in public repositories or images.
Example with environment variables:
# Using docker run
docker run -p 5006:5006 -e HF_TOKEN=your_token_here ghcr.io/salkinii/tabpfn-testing:latest
# Or using docker-compose with .env file
# Create .env file (not committed to git):
# HF_TOKEN=your_token_here
docker-compose -f docker-compose.prod.yml up -dWithout HF_TOKEN: The application works perfectly without a Hugging Face token, using statistical fallback methods for outlier and anomaly detection. The token is only needed if you want to use TabPFN's authenticated model access.
- Upload CSV File: Use the file upload widget in the sidebar to upload your CSV file
- Review Assessment: The dashboard will automatically assess data quality and display:
- Overall quality score (0-100)
- Summary cards with key metrics
- Missing values analysis
- Outlier detection results
- Anomaly scores
- Column-level quality metrics
- Clinical quality checks (for clinical data)
- Actionable recommendations
- CSV files with standard delimiters (comma, semicolon, tab)
- UTF-8 encoding (other encodings may be auto-detected)
- Headers in first row
- Any number of rows and columns
.
├── app.py # Main Panel application
├── data_quality.py # TabPFN-based quality assessment
├── visualizations.py # Panel visualization components
├── clinical_quality.py # Clinical-specific quality checks
├── utils.py # Helper functions
├── requirements.txt # Python dependencies
├── Dockerfile # Container definition
├── .dockerignore # Docker ignore file
├── LICENSE # Project license
└── README.md # This file
Composite score based on:
- Missing values (30% weight)
- Outliers (30% weight)
- Anomalies (20% weight)
- Consistency (20% weight)
- Missing Score: Penalizes missing values
- Outlier Score: Penalizes statistical outliers
- Anomaly Score: Penalizes anomalous records
- Consistency Score: Penalizes duplicate rows and data inconsistencies
For clinical medicine data, the application performs additional checks:
- Impossible values (e.g., age > 150)
- Temporal inconsistencies (e.g., discharge before admission)
- Referential integrity (missing/duplicate IDs)
- Clinical plausibility (e.g., BMI calculations)
All operations are logged to the logs/ directory:
- Assessment logs: Quality assessment runs and results
- Error logs: Application errors and exceptions
- Operation logs: File uploads and processing events
Logs are stored as JSON files with timestamps for easy parsing and analysis. The logs directory structure is automatically created when the application starts.
For production deployments, consider:
-
Volume Mounts: Mount the
logs/directory to persist logs:docker run -p 5006:5006 -v /path/to/logs:/app/logs tabpfn-data-quality
-
Environment Variables: Set via
-eflag or.envfile:docker run -p 5006:5006 -e HF_TOKEN=your_token tabpfn-data-quality
-
Resource Limits: Set appropriate CPU and memory limits:
docker run -p 5006:5006 --memory="2g" --cpus="2" tabpfn-data-quality
The application runs on port 5006 by default. To use a different port:
docker run -p 8080:5006 tabpfn-data-qualityThen access at http://localhost:8080
This project is licensed under the BSD 3-Clause License. See LICENSE file for details.
- Panel: BSD-3-Clause License (https://github.com/holoviz/panel)
- TabPFN: TABPFN-2.5 License v1.0 (https://docs.priorlabs.ai/models)
- Note: For production/commercial use, a commercial license is required from PriorLabs
Comprehensive documentation is available in the docs/ folder:
- User Guide: How to use the Panel dashboard application
- Pipeline Workflow: Operational workflow documentation
- TabPFN Data Quality Factors: Crucial factors about TabPFN's data quality aspects
- Logging Structure: Understanding log files and log analysis
- Panel >= 1.3.0 (BSD-3-Clause)
- TabPFN >= 6.0.0 (TABPFN-2.5 License)
- Pandas >= 2.0.0
- NumPy >= 1.24.0
- Plotly >= 5.17.0
- Matplotlib >= 3.7.0
For issues, questions, or contributions, please refer to the project repository or contact the maintainers.
- TabPFN: https://github.com/PriorLabs/tabpfn
- Panel: https://github.com/holoviz/panel
- TabPFN Documentation: https://docs.priorlabs.ai/models