coreason-inference
Project description
coreason-inference
Causal Discovery, Representation Learning, Active Experimentation, & Trial Optimization
coreason-inference is the Causal Intelligence engine of the CoReason ecosystem. Unlike probabilistic models that predict correlation, this engine is designed to uncover Mechanism and Heterogeneity. It serves as the "Principal Investigator," discovering biological feedback loops, identifying latent confounders, and optimizing clinical trials through causal stratification and virtual simulation.
Features
- Cyclic Discovery (Dynamics Engine): Uses Neural ODEs to discover feedback loops and system dynamics in biological systems (Directed Cyclic Graphs).
- Latent Phenotyping (Latent Miner): Disentangles hidden confounders using Causal VAEs to identify unmeasured variables driving outcomes.
- Heterogeneous Stratification (Causal Estimator): Estimates Individual Treatment Effects (CATE) using Causal Forests to identify Super-Responders.
- Active Experimentation (Active Scientist): Proposes physical experiments (e.g., Gene Knockouts) to resolve causal ambiguity using Information Gain heuristics.
- Protocol Optimization (Rule Inductor): Translates CATE scores into human-readable clinical protocol rules to maximize Phase 3 Probability of Success (PoS).
- Virtual Trials (Virtual Simulator): Simulates Phase 3 trials in-silico using synthetic "Digital Twins" to predict efficacy and scan for safety risks.
Installation
pip install coreason-inference
Usage
Here is a quick example of how to initialize and use the InferenceEngine:
import pandas as pd
from coreason_inference.engine import InferenceEngine
# 1. Initialize the Engine
engine = InferenceEngine()
# 2. Load your data
# Data should contain time-series or observational data
data = pd.read_csv("patient_data.csv")
variable_cols = ["Glucose", "Insulin", "HbA1c"]
time_col = "Time"
# 3. Analyze: Discover Dynamics & Latents
result = engine.analyze(
data=data,
time_col=time_col,
variable_cols=variable_cols,
estimate_effect_for=("Insulin", "Glucose")
)
# 4. Inspect the Causal Graph
print(f"Discovered Graph Edges: {result.graph.edges}")
print(f"Detected Loops: {result.graph.loop_dynamics}")
# 5. Optimize for Heterogeneity (Identify Super-Responders)
# Estimate CATE for a specific treatment
engine.analyze_heterogeneity(
treatment="Insulin",
outcome="Glucose",
confounders=["Age", "BMI"] + list(result.latents.columns)
)
# Induce rules to find the best subgroup
optimization_output = engine.induce_rules()
print("Recommended Protocol Criteria:")
for rule in optimization_output.new_criteria:
print(f" - {rule.feature} {rule.operator} {rule.value} ({rule.rationale})")
print(f"Projected Probability of Success: {optimization_output.optimized_pos:.2f}")
Documentation
For detailed requirements and architectural philosophy, please refer to the Product Requirements Document.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coreason_inference-0.3.0.tar.gz.
File metadata
- Download URL: coreason_inference-0.3.0.tar.gz
- Upload date:
- Size: 34.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4014988d208f9a09d4b944e6d6e189181b9081dd9123831832802b5b708ea3e0
|
|
| MD5 |
9889d38c31cbbf65ee3d808073911406
|
|
| BLAKE2b-256 |
9995f2cb537f342bfb9ed09a3da94e630b471d312e5e9d2c0533e19a298d3e1c
|
Provenance
The following attestation bundles were made for coreason_inference-0.3.0.tar.gz:
Publisher:
publish.yml on CoReason-AI/coreason-inference
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coreason_inference-0.3.0.tar.gz -
Subject digest:
4014988d208f9a09d4b944e6d6e189181b9081dd9123831832802b5b708ea3e0 - Sigstore transparency entry: 869845909
- Sigstore integration time:
-
Permalink:
CoReason-AI/coreason-inference@404c59253d17105e9674924dae6ac6e27198155e -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/CoReason-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@404c59253d17105e9674924dae6ac6e27198155e -
Trigger Event:
release
-
Statement type:
File details
Details for the file coreason_inference-0.3.0-py3-none-any.whl.
File metadata
- Download URL: coreason_inference-0.3.0-py3-none-any.whl
- Upload date:
- Size: 41.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e939fc9fe92e0cd9e8d88c955d949e7d23bbc210237ca26d373bc546f3ece74e
|
|
| MD5 |
2d6adad047604c38388327328416fbbb
|
|
| BLAKE2b-256 |
deea3692b3a3c88dfc5b35305821c33aa5f83fe856c18d2d46d972feb1ab30c1
|
Provenance
The following attestation bundles were made for coreason_inference-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on CoReason-AI/coreason-inference
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coreason_inference-0.3.0-py3-none-any.whl -
Subject digest:
e939fc9fe92e0cd9e8d88c955d949e7d23bbc210237ca26d373bc546f3ece74e - Sigstore transparency entry: 869845923
- Sigstore integration time:
-
Permalink:
CoReason-AI/coreason-inference@404c59253d17105e9674924dae6ac6e27198155e -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/CoReason-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@404c59253d17105e9674924dae6ac6e27198155e -
Trigger Event:
release
-
Statement type: