Skip to content

MMPC implementation #170

@kenneth-lee-ch

Description

@kenneth-lee-ch

I have looked at the MMPC documentation. How can I specify the target node for the MMPC? As far as I understand, MMPC is applied to a specific target and learn the parents and children of that node. I don't see any argument that takes the particular target node for MMPC.

The documentation shows the following example:

class MMPC(BNlearnAlgorithm):
    """Max-Min Parents-Children algorithm.

    **Description:** The Max-Min Parents-Children (MMPC) is a 2-phase algorithm
    with a forward pass and a backward pass. The forward phase adds recursively
    the variables that possess the highest association with the target
    conditionally to the already selected variables. The backward pass tests
    d-separability of variables conditionally to the set and subsets of the
    selected variables.

    **Required R packages**: bnlearn

    **Data Type:** Depends on the test used. Check
    :ref:`here <bnlearntests>` for the list of available tests.

    **Assumptions:** MMPC outputs markov blankets of nodes, with additional
    assumptions depending on the conditional test used.

    .. note::
       Tsamardinos I, Aliferis CF, Statnikov A (2003). "Time and Sample Efficient Discovery of Markov
       Blankets and Direct Causal Relations".  In "KDD ’03:  Proceedings of the Ninth ACM SIGKDD
       International Conference on Knowledge Discovery and Data Mining", pp. 673-678. ACM.
       Tsamardinos I, Brown LE, Aliferis CF (2006).  "The Max-Min Hill-Climbing Bayesian Network
       Structure Learning Algorithm".
       Machine Learning,65(1), 31-78.

    Example:
        >>> import networkx as nx
        >>> from cdt.causality.graph import MMPC
        >>> from cdt.data import load_dataset
        >>> data, graph = load_dataset("sachs")
        >>> obj = MMPC()
        >>> #The predict() method works without a graph, or with a
        >>> #directed or undirected graph provided as an input
        >>> output = obj.predict(data)    #No graph provided as an argument
        >>>
        >>> output = obj.predict(data, nx.Graph(graph))  #With an undirected graph
        >>>
        >>> output = obj.predict(data, graph)  #With a directed graph
        >>>
        >>> #To view the graph created, run the below commands:
        >>> nx.draw_networkx(output, font_size=8)
        >>> plt.show()
    """

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions