The first required edge (0,0) introduces a cycle and this is not
allowed for Bayesian networks. What results are you getting? I'm
assuming that the result object returned by the learner actually
includes no networks.
Abhik.
I think I know the cause for this.. The greedy learner doesn't
specifically look at the prior when suggesting networks. So, it
probably cannot find a single network to use as the seed for the
greedy learner because the prior returns -Infinity for any network
without required edges.
This is a limitation of the existing greedy learner. With small number
of nodes, the learner will randomly find networks with the required
edges but not for large networks. For now, you can supply a seed
network that already has the required edges:
seednet = network.Network(dataset.variables, [(1,2),(2,3)])
learner = greedy.GreedyLearner(dataset, pr, seed=seednet)
This way, the search is already starting at a valid network.
Thanks,
Abhik
2010/11/17 changhe <fuch...@gmail.com>: