Skip to content

Weird K2 implementation #1

@ThomasHoppe

Description

@ThomasHoppe

Hmmh, actually the implementation of the K2 function is a bit weird. Besides the data it takes a dictionary as input. In the supplied example the dictionary already contains the tree ! Thus, if in the for-loop of the K2 function for each node only the supplied parents of the node (tree_xi) are taken as input for the further computation, only the supplied tree can be reproduced.

The original paper of Cooper & Herskovitz says:
"Input: A set of n nodes, an ordering on the nodes, an upper bound u on the number of parents a node may have, and a database D containing m cases."

Thus, instead of a dictionary containing the ordering, an ordered set resp. a list needs to be used in order to avoid to inform the algorithm about the structure of the tree. Of course, then the upper bound on the number of parents needs to be supplied to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions