@Test public void test() throws Exception { MLforDBNsampling.main(null); }
public static void main(String[] args) throws IOException { Random random = new Random(1); DynamicBayesianNetworkGenerator.setNumberOfContinuousVars(2); DynamicBayesianNetworkGenerator.setNumberOfDiscreteVars(5); DynamicBayesianNetworkGenerator.setNumberOfStates(3); DynamicBayesianNetwork dbnRandom = DynamicBayesianNetworkGenerator.generateDynamicNaiveBayes(random,2,true); DynamicBayesianNetworkSampler sampler = new DynamicBayesianNetworkSampler(dbnRandom); sampler.setSeed(0); DataStream<DynamicDataInstance> data = sampler.sampleToDataBase(3,10000); ParameterLearningAlgorithm parallelMaximumLikelihood = new ParallelMaximumLikelihood(); parallelMaximumLikelihood.setWindowsSize(1000); parallelMaximumLikelihood.setDynamicDAG(dbnRandom.getDynamicDAG()); parallelMaximumLikelihood.initLearning(); parallelMaximumLikelihood.updateModel(data); DynamicBayesianNetwork dbnLearnt = parallelMaximumLikelihood.getLearntDBN(); System.out.println(dbnLearnt.toString()); }
MLforDBNsampling { public static void main(String[] args) throws IOException { Random random = new Random(1); DynamicBayesianNetworkGenerator.setNumberOfContinuousVars(2); DynamicBayesianNetworkGenerator.setNumberOfDiscreteVars(5); DynamicBayesianNetworkGenerator.setNumberOfStates(3); DynamicBayesianNetwork dbnRandom = DynamicBayesianNetworkGenerator.generateDynamicNaiveBayes(random,2,true); DynamicBayesianNetworkSampler sampler = new DynamicBayesianNetworkSampler(dbnRandom); sampler.setSeed(0); DataStream<DynamicDataInstance> data = sampler.sampleToDataBase(3,10000); ParameterLearningAlgorithm parallelMaximumLikelihood = new ParallelMaximumLikelihood(); parallelMaximumLikelihood.setWindowsSize(1000); parallelMaximumLikelihood.setDynamicDAG(dbnRandom.getDynamicDAG()); parallelMaximumLikelihood.initLearning(); parallelMaximumLikelihood.updateModel(data); DynamicBayesianNetwork dbnLearnt = parallelMaximumLikelihood.getLearntDBN(); System.out.println(dbnLearnt.toString()); } }
MLforDBNsampling { public static void main(String[] args) throws IOException { Random random = new Random(1); DynamicBayesianNetworkGenerator.setNumberOfContinuousVars(2); DynamicBayesianNetworkGenerator.setNumberOfDiscreteVars(5); DynamicBayesianNetworkGenerator.setNumberOfStates(3); DynamicBayesianNetwork dbnRandom = DynamicBayesianNetworkGenerator.generateDynamicNaiveBayes(random,2,true); DynamicBayesianNetworkSampler sampler = new DynamicBayesianNetworkSampler(dbnRandom); sampler.setSeed(0); DataStream<DynamicDataInstance> data = sampler.sampleToDataBase(3,10000); ParameterLearningAlgorithm parallelMaximumLikelihood = new ParallelMaximumLikelihood(); parallelMaximumLikelihood.setWindowsSize(1000); parallelMaximumLikelihood.setDynamicDAG(dbnRandom.getDynamicDAG()); parallelMaximumLikelihood.initLearning(); parallelMaximumLikelihood.updateModel(data); DynamicBayesianNetwork dbnLearnt = parallelMaximumLikelihood.getLearntDBN(); System.out.println(dbnLearnt.toString()); }  }
MLforDBNsampling { public static void main(String[] args) throws IOException { Random random = new Random(1); DynamicBayesianNetworkGenerator.setNumberOfContinuousVars(2); DynamicBayesianNetworkGenerator.setNumberOfDiscreteVars(5); DynamicBayesianNetworkGenerator.setNumberOfStates(3); DynamicBayesianNetwork dbnRandom = DynamicBayesianNetworkGenerator.generateDynamicNaiveBayes(random,2,true); DynamicBayesianNetworkSampler sampler = new DynamicBayesianNetworkSampler(dbnRandom); sampler.setSeed(0); DataStream<DynamicDataInstance> data = sampler.sampleToDataBase(3,10000); ParameterLearningAlgorithm parallelMaximumLikelihood = new ParallelMaximumLikelihood(); parallelMaximumLikelihood.setWindowsSize(1000); parallelMaximumLikelihood.setDynamicDAG(dbnRandom.getDynamicDAG()); parallelMaximumLikelihood.initLearning(); parallelMaximumLikelihood.updateModel(data); DynamicBayesianNetwork dbnLearnt = parallelMaximumLikelihood.getLearntDBN(); System.out.println(dbnLearnt.toString()); }  static void main(String[] args); }
MLforDBNsampling { public static void main(String[] args) throws IOException { Random random = new Random(1); DynamicBayesianNetworkGenerator.setNumberOfContinuousVars(2); DynamicBayesianNetworkGenerator.setNumberOfDiscreteVars(5); DynamicBayesianNetworkGenerator.setNumberOfStates(3); DynamicBayesianNetwork dbnRandom = DynamicBayesianNetworkGenerator.generateDynamicNaiveBayes(random,2,true); DynamicBayesianNetworkSampler sampler = new DynamicBayesianNetworkSampler(dbnRandom); sampler.setSeed(0); DataStream<DynamicDataInstance> data = sampler.sampleToDataBase(3,10000); ParameterLearningAlgorithm parallelMaximumLikelihood = new ParallelMaximumLikelihood(); parallelMaximumLikelihood.setWindowsSize(1000); parallelMaximumLikelihood.setDynamicDAG(dbnRandom.getDynamicDAG()); parallelMaximumLikelihood.initLearning(); parallelMaximumLikelihood.updateModel(data); DynamicBayesianNetwork dbnLearnt = parallelMaximumLikelihood.getLearntDBN(); System.out.println(dbnLearnt.toString()); }  static void main(String[] args);  }