Skip to content

Latest commit

 

History

History
112 lines (73 loc) · 3.48 KB

File metadata and controls

112 lines (73 loc) · 3.48 KB
title CausalFlow - Visual Bayesian Network Workbench
emoji 🔮
colorFrom blue
colorTo purple
sdk docker
app_port 7860

🔮 CausalFlow

The open-source, visual-first Bayesian Network workbench.

Build · Infer · Understand causality — in your browser.

GitHub License Live Demo


🚀 What is CausalFlow?

CausalFlow is an interactive workbench for building and analyzing Bayesian Networks. Drop a CSV or define nodes from scratch, draw causal relationships, and run exact inference — all through a drag-and-drop interface. No code, no installs, no MATLAB license.

Perfect for:

  • 📚 Students learning probabilistic graphical models
  • 🔬 Researchers prototyping causal models
  • 📊 Data Scientists exploring Bayesian inference

✨ Key Features

  • 🖱️ Visual DAG Editor — Drag-and-drop nodes & edges on an infinite canvas
  • 📊 Three Workflows — Data-driven (CSV → structure learning), expert knowledge, or hybrid
  • Real-Time Inference — Set evidence, watch posteriors update via Variable Elimination
  • 🔀 Auto Layout — Dagre-powered hierarchical layout
  • 🧠 Smart CSV Ingestion — Auto-detect discrete variables and state spaces
  • 🎯 CPT Editor — Define conditional probability tables by hand
  • 🏗️ Structure Learning — Hill-Climbing algorithm discovers causal structure
  • 🌐 Zero Install — Runs entirely in the browser

🎬 Quick Demo

  1. Upload a CSV → Click "Upload CSV" in the sidebar
  2. Learn Structure → Auto-discover causal relationships
  3. Set Evidence → Click on a node, select a state
  4. Run Inference → Watch probabilities propagate in real-time

🏗️ Tech Stack

Frontend: React 19 · React Flow · Zustand · Tailwind CSS · Recharts
Backend: FastAPI · pgmpy · NetworkX · PyTorch (CPU)
Algorithms: Variable Elimination · Hill-Climbing Structure Learning


📖 Usage Tips

Example: Titanic Survival Analysis

  1. Upload the Titanic dataset (built-in example)
  2. The system auto-detects variables: Survived, Pclass, Sex, Age
  3. Learn structure or manually draw edges
  4. Set evidence: Sex=female, Pclass=1st
  5. Query: P(Survived=Yes | Sex=female, Pclass=1st) ≈ 0.97

Example: Medical Diagnosis

  1. Create nodes: Symptom, Disease, Test Result
  2. Define CPTs manually (if no data)
  3. Set evidence: Symptom=fever, Test=positive
  4. Infer: P(Disease | evidence)

🔗 Links


🤝 Contributing

PRs are welcome! See CONTRIBUTING.md.


📝 License

MIT © shuqiwhat


Built with ❤️ by @shuqiwhat

If you find this helpful, give it a ⭐ on GitHub!