Expand description
§Causal Discovery Language (CDL)
CDL hosts two discovery algorithms — SURD and BRCD — as two compile-time-isolated
typestate sub-pipelines that converge on a shared analyze/finalize tail. A sub-pipeline is
seeded by CdlBuilder::build_surd / CdlBuilder::build_brcd from a run config
built by CdlConfigBuilder.
§Compile-time sub-pipeline isolation
Each algorithm’s stage methods exist only on its own states, so crossing the sub-pipelines does not compile. Calling a BRCD stage on a SURD state:
ⓘ
use deep_causality_discovery::{CDL, SurdData};
fn cross(c: CDL<SurdData<f64>>) {
let _ = c.brcd_discover(); // error[E0599]: no method named `brcd_discover`
}Calling a SURD analyze on a BRCD state:
ⓘ
use deep_causality_discovery::{CDL, BrcdLoaded};
fn cross(c: CDL<BrcdLoaded<f64>>) {
let _ = c.surd_analyze(); // error[E0599]: no method named `surd_analyze`
}Feature selection is unavailable to the BRCD sub-pipeline:
ⓘ
use deep_causality_discovery::{CDL, BrcdConfigured};
fn cross(c: CDL<BrcdConfigured<f64>>) {
let _ = c.feature_select(); // error[E0599]: no method named `feature_select`
}Modules§
- brcd_
analyze_ config - brcd_
loader_ config - causal_
discovery_ config - data_
csv_ config - data_
loader_ config - data_
parquet_ config - data_
preprocess_ config - feature_
selector_ config - mrmr_
config - surd_
analyze_ config - surd_
config - surd_
loader_ config
Structs§
- Brcd
Analyze Config - Configuration for the BRCD analysis phase of the CDL pipeline.
- Brcd
Config - Configuration for a BRCD run.
- Brcd
Configured - BRCD entry state, carrying the run config from
CdlBuilder::build_brcd. - Brcd
Error - The error type returned by every fallible BRCD operation.
- Brcd
Input - The fully-prepared input for a BRCD discovery run.
- Brcd
Loaded - BRCD state after the input bundle has been loaded.
- Brcd
Loader Config - The fully-specified configuration for a BRCD CDL run.
- Brcd
Result - A structured result for a BRCD root-cause discovery run.
- Brcd
Result Analyzer - An implementation of
ProcessResultAnalyzerforBrcdResult. - Brcd
Results - BRCD state after the BRCD algorithm has run.
- CDL
- The core builder for the Causal Discovery Language (CDL) pipeline.
- CdlBuilder
- Entry point for constructing and running a CDL pipeline.
- CdlConfig
Builder - Entry point for the staged CDL config builders.
- CdlEffect
- CdlEffect
Witness - A witness type that “fixes” the Error (E) and Warning Log (WLog) types
for
CdlEffect, implementing theHKTandHKT3traits. - CdlReport
- Aggregates all significant findings from a CDL pipeline execution.
- CdlWarning
Log - Console
Formatter - A concrete implementation of
ProcessResultFormatterthat formats an analysis for display in the console. - CsvConfig
- Configuration for loading data from a CSV file.
- CsvData
Loader - A concrete implementation of
ProcessDataLoaderfor reading data from CSV files. - Data
Discretizer - A concrete implementation of
DataPreprocessorthat discretizes continuous data into bins. - Missing
Value Imputer - A pre-processor for handling missing numerical data in a
CausalTensor. - Mixed
Graph - A mixed graph over
num_verticesnodes with typed edge endpoints. - Mrmr
Config - Configuration for the MRMR (Max-Relevance, Min-Redundancy) feature selector.
- Mrmr
Feature Selector - A concrete implementation of the
FeatureSelectortrait that uses the MRMR algorithm. - Option
None Data Cleaner - Parquet
Config - Configuration for loading data from a Parquet file.
- Parquet
Data Loader - A concrete implementation of
ProcessDataLoaderfor reading data from Parquet files. - Preprocess
Config - Configuration for a data discretization pre-processing step.
- Process
Analysis - A wrapper struct holding the results of an analysis as a vector of strings.
- Process
Formatted Result - A wrapper struct holding the final, formatted output of the CDL pipeline.
- Surd
Analyze Config - Configuration for the SURD analysis phase of the CDL pipeline.
- Surd
Causal Discovery - A concrete implementation of the
CausalDiscoverytrait using the SURD algorithm. - Surd
Cleaned - SURD state after data has been cleaned (masked to
Option<T>). - Surd
Config - Configuration for the SURD (Synergistic, Unique, Redundant Decomposition) algorithm.
- Surd
Configured - SURD entry state, carrying the run config from
CdlBuilder::build_surd. - Surd
Data - SURD state after data has been loaded.
- Surd
Features - SURD state after feature selection has been applied.
- Surd
Loader Config - The fully-specified configuration for a SURD CDL run.
- Surd
Result Analyzer - An implementation of
ProcessResultAnalyzerforSurdResult. - Surd
Results - SURD state after the SURD algorithm has run.
- With
Analysis - State after the raw discovery result has been analyzed. Both sub-pipelines
converge here, carrying the polymorphic
CdlDiscoveryOutcome.
Enums§
- Analyze
Error - Binning
Strategy - Brcd
Load Error - Failure cases for [
crate::BrcdDataLoader] building acrate::BrcdInput. - Causal
Discovery Config - An enum representing the configuration for a specific causal discovery algorithm.
- Causal
Discovery Error - CdlDiscovery
Outcome - The algorithm-specific result of a CDL discovery run.
- CdlError
- CdlWarning
- Column
Selector - Cpdag
Error - Failure cases for reading or writing a CPDAG CSV file.
- Data
Cleaning Error - Data
Loader Config - An enum representing the configuration for a specific data loader.
- Data
Loading Error - Family
Kind - The likelihood family BRCD scores each node with.
- Feature
Select Error - Feature
Selector Config - An enum representing the configuration for a specific feature selection algorithm.
- Finalize
Error - Mark
- The mark at one endpoint of an edge, in the typed-endpoint calculus shared by CPDAGs, MAGs, and PAGs.
- MaxOrder
- Defines the maximum order of interactions to consider in the SURD analysis.
- Preprocess
Error
Traits§
- Causal
Discovery - Defines the contract for causal discovery algorithms.
- Data
Cleaner - Data
Loader - Defines the contract for loading data from a source into a
CausalTensor. - Data
Preprocessor - Defines the contract for data pre-processing steps.
- Feature
Selector - Defines the contract for feature selection algorithms.
- Precision
- Precision bound for the CDL compute pipeline.
- Process
Result Analyzer - Defines the contract for analyzing the raw results of a causal discovery algorithm.
- Process
Result Formatter - Defines the contract for formatting an analysis into a final output string.
Functions§
- brcd_
run - Runs BRCD on the normal/anomalous datasets and returns the candidate root-cause sets ranked by descending posterior.
- load_
cpdag_ csv - Reads a CPDAG CSV file from
pathinto a unit-payloadMixedGraph. - mrmr_
features_ selector - Selects features using the mRMR (Maximum Relevance, Minimum Redundancy) algorithm.
- save_
cpdag_ csv - Writes
graphtopathas a CPDAG CSV file. - surd_
states_ cdl - Decomposes mutual information into its Synergistic, Unique, and Redundant components
for each state of the target variable, based on the SURD-states algorithm,
specifically designed to handle input tensors with
Option<T>values.