Skip to main content

type_definitions

EdgeConstraint

from cai_causal_graph.type_definitions import EdgeConstraint

class EdgeConstraint(str, Enum)

Enumeration defining the types of edge constraints for domain knowledge.

The enumeration members are:

  • EdgeConstraint.HARD_DIRECTED_EDGE
  • EdgeConstraint.HARD_UNDIRECTED_EDGE
  • EdgeConstraint.SOFT_DIRECTED_EDGE
  • EdgeConstraint.FORBIDDEN_EDGE

Methods

__str__

def __str__() -> str

Return the string value for the enumeration.

EdgeType

from cai_causal_graph.type_definitions import EdgeType

class EdgeType(str, Enum)

Enumeration defining the types of edges the graph can contain.

The enumeration members are:

  • EdgeType.UNDIRECTED_EDGE
  • EdgeType.DIRECTED_EDGE
  • EdgeType.BIDIRECTED_EDGE
  • EdgeType.UNKNOWN_EDGE
  • EdgeType.UNKNOWN_DIRECTED_EDGE
  • EdgeType.UNKNOWN_UNDIRECTED_EDGE

Methods

__str__

def __str__() -> str

Return the string value for the enumeration.

NodeVariableType

from cai_causal_graph.type_definitions import NodeVariableType

class NodeVariableType(str, Enum)

Enumeration defining the types of variable a node in a graph can represent.

The enumeration members are:

  • NodeVariableType.UNSPECIFIED
  • NodeVariableType.CONTINUOUS
  • NodeVariableType.BINARY
  • NodeVariableType.MULTICLASS
  • NodeVariableType.ORDINAL

Methods

__str__

def __str__() -> str

Return the string value for the enumeration.

validate_pair_type

def validate_pair_type(pair: Union[PAIR_T, Tuple[NodeLike, NodeLike]])

Validate an edge pair type by raising a cai_causal_graph.exceptions.CausalGraphErrors.EdgeInvalidError if it is not an expected type.