vraven.decompiler · class
MechanismProgram
MechanismProgram(target: 'int', concept_ids: 'tuple[str, ...]', concept_labels: 'dict[str, str]', intercept: 'float', rules: 'list[ProgrammeRule]', fidelity: 'ProgrammeFidelity', validity: 'dict[str, Any]' = <factory>, metadata: 'dict[str, Any]' = <factory>) -> NoneMechanismProgram(target: 'int', concept_ids: 'tuple[str, ...]', concept_labels: 'dict[str, str]', intercept: 'float', rules: 'list[ProgrammeRule]', fidelity: 'ProgrammeFidelity', validity: 'dict[str, Any]' = <factory>, metadata: 'dict[str, Any]' = <factory>)
Usage
from vraven.decompiler import MechanismProgram
value = MechanismProgram(...)
Methods
contributions(self, concept_values: 'np.ndarray | Sequence[Sequence[float]]') -> 'dict[str, np.ndarray]'
Public method.
from_dict(payload: 'Mapping[str, Any]') -> "'MechanismProgram'"
Public method.
intervene(self, concept_values: 'np.ndarray | Sequence[Sequence[float]]', replacements: 'Mapping[str, float | np.ndarray]') -> 'np.ndarray'
Public method.
predict_target(self, concept_values: 'np.ndarray | Sequence[Sequence[float]]') -> 'np.ndarray'
Public method.
score(self, concept_values: 'np.ndarray | Sequence[Sequence[float]]') -> 'np.ndarray'
Public method.
to_c_code(self) -> 'str'
Export the decompiled causal mechanism program into pure standalone ANSI C source code.
to_dict(self) -> 'dict[str, Any]'
Public method.
to_pseudocode(self) -> 'str'
Public method.
to_python_code(self) -> 'str'
Export the decompiled causal mechanism program as a pure standalone executable Python function.
Source of truthThis page is generated from the checked-out public symbol, signature, and docstring. Pin the package version for reproducible work.