PC learning in Java

The engine.
Post Reply
Branislav
Posts: 1
Joined: Fri Apr 08, 2011 6:33 pm

PC learning in Java

Post by Branislav »

Hello,
I have problem with generating network using PC alg. in Java. All I have is just pattern. This pattern is not DAG and I don't know how to turn it into DAG in Java.
Here's my code:
Network net = new Network();
DataSet ds = new DataSet();
ds.readFile(sfile);
initNetwork(net, ds, tagcnt); // my method
DataMatch[] matching = ds.matchNetwork(net);

final PC pc = new PC();
pc.setMaxAdjacency(8);
pc.setSignificance(0.05);
Pattern pt = pc.learn(ds);

if(!pt.isDAG())
// some code to convert it to DAG???
-------
Can you tell me please what exactly means pattern.setMaxAdjacency(int) and pattern.setSignificance(double)?
Thanx for help :)

B.
shooltz[BayesFusion]
Site Admin
Posts: 1461
Joined: Mon Nov 26, 2007 5:51 pm

Re: PC learning in Java

Post by shooltz[BayesFusion] »

Branislav wrote:I have problem with generating network using PC alg. in Java. All I have is just pattern. This pattern is not DAG and I don't know how to turn it into DAG in Java.
The pattern is the output from the PC algorithm. SMILearn (and jSMILE) does not contain any functionality for DAG conversion - you'll need to convert pattern to DAG from your code with the calls to Pattern.setEdge, or use GeNIe and manually make the pattern into a DAG.
Can you tell me please what exactly means pattern.setMaxAdjacency(int) and pattern.setSignificance(double)?
These methods apply to the PC class, not Pattern class.
Post Reply