{"id":49097446,"url":"https://github.com/athammad/onlinecml","last_synced_at":"2026-04-20T21:37:54.182Z","repository":{"id":350609009,"uuid":"1207581507","full_name":"athammad/onlinecml","owner":"athammad","description":"Online Causal Machine Learning in Python — one observation at a time","archived":false,"fork":false,"pushed_at":"2026-04-11T06:05:07.000Z","size":4101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-11T07:24:24.686Z","etag":null,"topics":["a-b-testing","causal-inference","causal-machine-learning","econometrics","heterogeneous-effects","incremental-learning","machine-learning-algorithms","online-learning-algorithms","python"],"latest_commit_sha":null,"homepage":"https://athammad.github.io/onlinecml","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/athammad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing/adding_estimator.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-11T05:45:49.000Z","updated_at":"2026-04-11T06:05:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/athammad/onlinecml","commit_stats":null,"previous_names":["athammad/onlinecml"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/athammad/onlinecml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athammad%2Fonlinecml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athammad%2Fonlinecml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athammad%2Fonlinecml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athammad%2Fonlinecml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/athammad","download_url":"https://codeload.github.com/athammad/onlinecml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athammad%2Fonlinecml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32067622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T21:26:33.338Z","status":"ssl_error","status_checked_at":"2026-04-20T21:26:22.081Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a-b-testing","causal-inference","causal-machine-learning","econometrics","heterogeneous-effects","incremental-learning","machine-learning-algorithms","online-learning-algorithms","python"],"created_at":"2026-04-20T21:37:53.509Z","updated_at":"2026-04-20T21:37:54.177Z","avatar_url":"https://github.com/athammad.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"docs/assets/logo_small.png\" alt=\"OnlineCML\" width=\"180\" align=\"right\"/\u003e\n\n*Causal inference for the real world — one observation at a time.*\n\n[![CI](https://github.com/athammad/onlinecml/actions/workflows/ci.yml/badge.svg)](https://github.com/athammad/onlinecml/actions/workflows/ci.yml)\n\\\n[![Coverage](https://img.shields.io/badge/coverage-97%25-brightgreen)](https://github.com/athammad/onlinecml)\n[![Docs](https://img.shields.io/badge/docs-athammad.github.io%2Fonlinecml-blue)](https://athammad.github.io/onlinecml/)\n\n## Why OnlineCML?\n\nEvery major causal inference library (EconML, CausalML, DoWhy) requires a\ncomplete dataset before you begin. But many real-world applications don't\nhave that luxury:\n\n- A/B tests where you want decisions *now*, not after 30 days\n- Clinical trials where treatment effects must be monitored continuously\n- Marketing systems where customer data arrives as a stream\n- Any setting where the treatment effect might shift over time\n\nOnlineCML processes one observation at a time. No batches. No waiting.\n\n## Installation\n\n```bash\npip install onlinecml\n```\n\n## Quickstart\n\n```python\nfrom onlinecml.datasets import LinearCausalStream\nfrom onlinecml.reweighting import OnlineIPW\n\nestimator = OnlineIPW()\nfor x, treatment, outcome, _ in LinearCausalStream(n=1000, true_ate=2.0, seed=42):\n    estimator.learn_one(x, treatment, outcome)\n\nprint(f\"ATE:   {estimator.predict_ate():.3f}\")  # → ~2.0\nprint(f\"95%CI: {estimator.predict_ci()}\")\n```\n\n## Methods\n\n| Method | Class | ATE | Individual CATE | Doubly Robust |\n|---|---|:---:|:---:|:---:|\n| Inverse Probability Weighting | `OnlineIPW` | ✓ | — | — |\n| Augmented IPW | `OnlineAIPW` | ✓ | ✓ | ✓ |\n| Overlap Weights | `OnlineOverlapWeights` | ✓ | — | — |\n| S-Learner | `OnlineSLearner` | ✓ | ✓ | — |\n| T-Learner | `OnlineTLearner` | ✓ | ✓ | — |\n| X-Learner | `OnlineXLearner` | ✓ | ✓ | — |\n| R-Learner | `OnlineRLearner` | ✓ | ✓ | — |\n| Online Matching | `OnlineMatching` | ✓ | ✓ | — |\n| Caliper Matching | `OnlineCaliperMatching` | ✓ | ✓ | — |\n| Causal Hoeffding Tree | `CausalHoeffdingTree` | ✓ | ✓ | ✓ |\n| Online Causal Forest | `OnlineCausalForest` | ✓ | ✓ | ✓ |\n\n**Novel contributions:** `CausalHoeffdingTree` and `OnlineCausalForest` implement a\ncustom causal split criterion that maximises between-child CATE variance rather than\noutcome MSE, with linear leaf models, doubly robust correction, multi-threshold split\nsearch, and per-tree ADWIN drift detection.\n\n**Policies:** `EpsilonGreedy`, `ThompsonSampling`, `UCB`\n\n**Diagnostics:** `OnlineSMD`, `ATETracker` (with convergence plot and forgetting factor),\n`OverlapChecker`, `ConceptDriftMonitor`\n\n**Datasets:** `LinearCausalStream`, `HeterogeneousCausalStream`, `DriftingCausalStream`,\n`UnbalancedCausalStream`, `ContinuousTreatmentStream`\n\n**Evaluation:** `progressive_causal_score`, `PEHE`, `ATEError`, `UpliftAUC`, `QiniCoefficient`\n\n## How it differs from batch libraries\n\n| | DoWhy | EconML | CausalML | **OnlineCML** |\n|---|:---:|:---:|:---:|:---:|\n| Online / streaming | ✗ | ✗ | ✗ | **✓** |\n| One-obs-at-a-time | ✗ | ✗ | ✗ | **✓** |\n| Concept drift | ✗ | ✗ | ✗ | **✓** |\n| Exploration policy | ✗ | ✗ | ✗ | **✓** |\n| River compatible | ✗ | ✗ | ✗ | **✓** |\n| Online causal forest | ✗ | ✗ | ✗ | **✓** |\n| IPW / DR / Overlap | ✓ | ✓ | ✓ | **✓** |\n| Meta-learners | ✓ | ✓ | ✓ | **✓** |\n| CATE estimation | ✓ | ✓ | ✓ | **✓** |\n\n## Documentation\n\nFull documentation and example notebooks at [athammad.github.io/onlinecml](https://athammad.github.io/onlinecml/).\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md). All PRs require unit tests and\nmust maintain \u003e90% coverage.\n\n## Citation\n\n```bibtex\n@software{onlinecml2025,\n  title  = {OnlineCML: Online Causal Machine Learning in Python},\n  author = {Hammad, Ahmed},\n  year   = {2025},\n  url    = {https://github.com/athammad/onlinecml}\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathammad%2Fonlinecml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fathammad%2Fonlinecml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathammad%2Fonlinecml/lists"}