causal-learn
  • 入门指南
  • 搜索方法
    • 基于约束的因果发现方法
    • 基于分数的因果发现方法
      • 使用 BIC 分数或通用分数的 GES
      • 精确搜索
        • 算法介绍
        • 用法
        • 参数
        • 返回值
    • 基于约束函数因果模型的因果发现方法
    • 隐因果表示学习
    • 基于排列的因果发现方法
    • Granger 因果关系
  • (条件)独立性检验
  • 分数函数
  • 工具函数
causal-learn
  • 搜索方法
  • 基于分数的因果发现方法
  • 精确搜索
  • 查看页面源码

精确搜索

算法介绍

使用动态规划 (DP [1]) 或 A* 搜索 [2] 来搜索最优图结构。

用法

from causallearn.search.ScoreBased.ExactSearch import bic_exact_search
dag_est, search_stats = bic_exact_search(X, super_graph, search_method,
                 use_path_extension, use_k_cycle_heuristic,
                 k, verbose, include_graph, max_parents)

参数

X: numpy.ndarray, shape=(n, d). 用于拟合结构的数据,其中每一行是一个样本,每一列对应相关的变量。

super_graph: numpy.ndarray, shape=(d, d). 限制搜索空间的超结构(二进制矩阵)。如果为 None,则不使用超结构。默认为 None。

search_method: str. 精确搜索的方法 ([‘astar’, ‘dp’])。默认为 astar。

use_path_extension: bool. 是否对排序图使用最优路径扩展。注意,此技巧不会影响搜索过程的正确性。默认为 True。

use_k_cycle_heuristic: bool. 是否对 astar 使用 k 周期冲突启发式。默认为 False。

k: int. astar 的 k 周期冲突启发式使用的参数。默认为 3。

verbose: bool. 是否记录与搜索过程相关的消息。

max_parents: int. 节点可以拥有的最大父节点数量。如果使用此参数,则表示使用 k-learn 过程。可以显著加快算法速度。如果为 None,则对父节点数量没有限制。默认为 None。

返回值

dag_est: numpy.ndarray, shape=(d, d). 估计的 DAG(有向无环图)。

search_stats: dict. 与搜索过程相关的一些统计信息。

[1]

Silander, T., & Myllymäki, P. (2006, July). A simple approach for finding the globally optimal Bayesian network structure. In Proceedings of the Twenty-Second Conference on Uncertainty in Artificial Intelligence (pp. 445-452).

[2]

Yuan, C., & Malone, B. (2013). Learning optimal Bayesian networks: A shortest path perspective. Journal of Artificial Intelligence Research, 48, 23-65.

上一页 下一页

© Copyright 2021, CLeaR.

Built with Sphinx using a theme provided by Read the Docs.