和顺 / 知几 返回所属 Agent
ZJ-05.02

驱动与传导

原能力

说明每个假设依赖的主因、传播路径、延迟及受影响对象。(细化版 p.4–5)

首选项目

DoWhy(MIT)。 DoWhy

匹配范围

有向图表示路径,因果模型表达驱动假设。

源码

DoWhy · def identify_effect(

dowhy/causal_model.py · 234–247 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
    def identify_effect(
        self, estimand_type=None, method_name="default", proceed_when_unidentifiable=None, optimize_backdoor=False
    ):
        """Identify the causal effect to be estimated, using properties of the causal graph.

        :param method_name: Method name for identification algorithm. ("id-algorithm" or "default")
        :param proceed_when_unidentifiable: Binary flag indicating whether identification should proceed in the presence of (potential) unobserved confounders.
        :returns: a probability expression (estimand) for the causal effect if identified, else NULL

        """
        if proceed_when_unidentifiable is None:
            proceed_when_unidentifiable = self._proceed_when_unidentifiable
        if estimand_type is None:
            estimand_type = self._estimand_type

NetworkX · def shortest_path(

networkx/algorithms/shortest_paths/generic.py · 43–56 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
def shortest_path(G, source=None, target=None, weight=None, method="dijkstra"):
    """Compute shortest paths in the graph.

    Parameters
    ----------
    G : NetworkX graph

    source : node, optional
        Starting node for path. If not specified, compute shortest
        paths for each possible starting node.

    target : node, optional
        Ending node for path. If not specified, compute shortest
        paths to all possible nodes.

实现与验收要点

定义延迟、实证支持、影响对象和可被推翻的预期。