causalnex.structure.notears.from_numpy_lasso(X, beta, max_iter=100, h_tol=1e-08, w_threshold=0.0, tabu_edges=None, tabu_parent_nodes=None, tabu_child_nodes=None)[source]

Learn the StructureModel, the graph structure with lasso regularisation describing conditional dependencies between variables in data presented as a numpy array.

Based on DAGs with NO TEARS. @inproceedings{zheng2018dags,

author = {Zheng, Xun and Aragam, Bryon and Ravikumar, Pradeep and Xing, Eric P.}, booktitle = {Advances in Neural Information Processing Systems}, title = {{DAGs with NO TEARS: Continuous Optimization for Structure Learning}}, year = {2018}, codebase = {}


  • X (ndarray) – 2d input data, axis=0 is data rows, axis=1 is data columns. Data must be row oriented.
  • beta (float) – Constant that multiplies the lasso term.
  • max_iter (int) – max number of dual ascent steps during optimisation.
  • h_tol (float) – exit if h(W) < h_tol (as opposed to strict definition of 0).
  • w_threshold (float) – fixed threshold for absolute edge weights.
  • tabu_edges (Optional[List[Tuple[int, int]]]) – list of edges(from, to) not to be included in the graph.
  • tabu_parent_nodes (Optional[List[int]]) – list of nodes banned from being a parent of any other nodes.
  • tabu_child_nodes (Optional[List[int]]) – list of nodes banned from being a child of any other nodes.

a graph of conditional dependencies between data variables.

Return type:



ValueError – If X does not contain data.