@Test public void test() throws Exception { String args[] = {"3","500", "5", "true"}; GenerateData.main(args); DynamicNaiveBayes.main(null); }
public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); conf.setInteger("taskmanager.network.numberOfBuffers", 12000); final ExecutionEnvironment env = ExecutionEnvironment.createLocalEnvironment(conf); env.getConfig().disableSysoutLogging(); env.setParallelism(Main.PARALLELISM); Boolean includeHidden = true; String fileName = "./datasets/simulated/tmp_conceptdrift_data"; DataFlink<DynamicDataInstance> data0 = DataFlinkLoader.loadDynamicDataFromFolder(env,fileName+0+".arff", false); DynamicDAG NBdag = includeHidden? createDynamicNaiveBayesWithHidden(data0.getAttributes()): createDynamicNaiveBayes(data0.getAttributes()); System.out.println(NBdag.toString()); int nsets = 3; long start = System.nanoTime(); DynamicParallelVB parallelVB = new DynamicParallelVB(); parallelVB.setGlobalThreshold(0.1); parallelVB.setMaximumGlobalIterations(10); parallelVB.setLocalThreshold(0.1); parallelVB.setMaximumLocalIterations(100); parallelVB.setSeed(5); parallelVB.setOutput(true); parallelVB.setBatchSize(500); parallelVB.setDAG(NBdag); parallelVB.initLearning(); System.out.println("--------------- DATA " + 0 + " --------------------------"); parallelVB.updateModelWithNewTimeSlice(0, data0); for (int i = 1; i < nsets; i++) { logger.info("--------------- DATA " + i + " --------------------------"); DataFlink<DynamicDataInstance> dataNew = DataFlinkLoader.loadDynamicDataFromFolder(env, fileName+i+".arff", false); parallelVB.updateModelWithNewTimeSlice(i, dataNew); } long duration = (System.nanoTime() - start) / 1; double seconds = duration / 1000000000.0; System.out.printf("Running time: "+seconds+ "seconds"); }
DynamicNaiveBayes { public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); conf.setInteger("taskmanager.network.numberOfBuffers", 12000); final ExecutionEnvironment env = ExecutionEnvironment.createLocalEnvironment(conf); env.getConfig().disableSysoutLogging(); env.setParallelism(Main.PARALLELISM); Boolean includeHidden = true; String fileName = "./datasets/simulated/tmp_conceptdrift_data"; DataFlink<DynamicDataInstance> data0 = DataFlinkLoader.loadDynamicDataFromFolder(env,fileName+0+".arff", false); DynamicDAG NBdag = includeHidden? createDynamicNaiveBayesWithHidden(data0.getAttributes()): createDynamicNaiveBayes(data0.getAttributes()); System.out.println(NBdag.toString()); int nsets = 3; long start = System.nanoTime(); DynamicParallelVB parallelVB = new DynamicParallelVB(); parallelVB.setGlobalThreshold(0.1); parallelVB.setMaximumGlobalIterations(10); parallelVB.setLocalThreshold(0.1); parallelVB.setMaximumLocalIterations(100); parallelVB.setSeed(5); parallelVB.setOutput(true); parallelVB.setBatchSize(500); parallelVB.setDAG(NBdag); parallelVB.initLearning(); System.out.println("--------------- DATA " + 0 + " --------------------------"); parallelVB.updateModelWithNewTimeSlice(0, data0); for (int i = 1; i < nsets; i++) { logger.info("--------------- DATA " + i + " --------------------------"); DataFlink<DynamicDataInstance> dataNew = DataFlinkLoader.loadDynamicDataFromFolder(env, fileName+i+".arff", false); parallelVB.updateModelWithNewTimeSlice(i, dataNew); } long duration = (System.nanoTime() - start) / 1; double seconds = duration / 1000000000.0; System.out.printf("Running time: "+seconds+ "seconds"); } }
DynamicNaiveBayes { public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); conf.setInteger("taskmanager.network.numberOfBuffers", 12000); final ExecutionEnvironment env = ExecutionEnvironment.createLocalEnvironment(conf); env.getConfig().disableSysoutLogging(); env.setParallelism(Main.PARALLELISM); Boolean includeHidden = true; String fileName = "./datasets/simulated/tmp_conceptdrift_data"; DataFlink<DynamicDataInstance> data0 = DataFlinkLoader.loadDynamicDataFromFolder(env,fileName+0+".arff", false); DynamicDAG NBdag = includeHidden? createDynamicNaiveBayesWithHidden(data0.getAttributes()): createDynamicNaiveBayes(data0.getAttributes()); System.out.println(NBdag.toString()); int nsets = 3; long start = System.nanoTime(); DynamicParallelVB parallelVB = new DynamicParallelVB(); parallelVB.setGlobalThreshold(0.1); parallelVB.setMaximumGlobalIterations(10); parallelVB.setLocalThreshold(0.1); parallelVB.setMaximumLocalIterations(100); parallelVB.setSeed(5); parallelVB.setOutput(true); parallelVB.setBatchSize(500); parallelVB.setDAG(NBdag); parallelVB.initLearning(); System.out.println("--------------- DATA " + 0 + " --------------------------"); parallelVB.updateModelWithNewTimeSlice(0, data0); for (int i = 1; i < nsets; i++) { logger.info("--------------- DATA " + i + " --------------------------"); DataFlink<DynamicDataInstance> dataNew = DataFlinkLoader.loadDynamicDataFromFolder(env, fileName+i+".arff", false); parallelVB.updateModelWithNewTimeSlice(i, dataNew); } long duration = (System.nanoTime() - start) / 1; double seconds = duration / 1000000000.0; System.out.printf("Running time: "+seconds+ "seconds"); }  }
DynamicNaiveBayes { public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); conf.setInteger("taskmanager.network.numberOfBuffers", 12000); final ExecutionEnvironment env = ExecutionEnvironment.createLocalEnvironment(conf); env.getConfig().disableSysoutLogging(); env.setParallelism(Main.PARALLELISM); Boolean includeHidden = true; String fileName = "./datasets/simulated/tmp_conceptdrift_data"; DataFlink<DynamicDataInstance> data0 = DataFlinkLoader.loadDynamicDataFromFolder(env,fileName+0+".arff", false); DynamicDAG NBdag = includeHidden? createDynamicNaiveBayesWithHidden(data0.getAttributes()): createDynamicNaiveBayes(data0.getAttributes()); System.out.println(NBdag.toString()); int nsets = 3; long start = System.nanoTime(); DynamicParallelVB parallelVB = new DynamicParallelVB(); parallelVB.setGlobalThreshold(0.1); parallelVB.setMaximumGlobalIterations(10); parallelVB.setLocalThreshold(0.1); parallelVB.setMaximumLocalIterations(100); parallelVB.setSeed(5); parallelVB.setOutput(true); parallelVB.setBatchSize(500); parallelVB.setDAG(NBdag); parallelVB.initLearning(); System.out.println("--------------- DATA " + 0 + " --------------------------"); parallelVB.updateModelWithNewTimeSlice(0, data0); for (int i = 1; i < nsets; i++) { logger.info("--------------- DATA " + i + " --------------------------"); DataFlink<DynamicDataInstance> dataNew = DataFlinkLoader.loadDynamicDataFromFolder(env, fileName+i+".arff", false); parallelVB.updateModelWithNewTimeSlice(i, dataNew); } long duration = (System.nanoTime() - start) / 1; double seconds = duration / 1000000000.0; System.out.printf("Running time: "+seconds+ "seconds"); }  static DynamicDAG createDynamicNaiveBayes(Attributes attributes); static DynamicDAG createDynamicNaiveBayesWithHidden(Attributes attributes); static void main(String[] args); }
DynamicNaiveBayes { public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); conf.setInteger("taskmanager.network.numberOfBuffers", 12000); final ExecutionEnvironment env = ExecutionEnvironment.createLocalEnvironment(conf); env.getConfig().disableSysoutLogging(); env.setParallelism(Main.PARALLELISM); Boolean includeHidden = true; String fileName = "./datasets/simulated/tmp_conceptdrift_data"; DataFlink<DynamicDataInstance> data0 = DataFlinkLoader.loadDynamicDataFromFolder(env,fileName+0+".arff", false); DynamicDAG NBdag = includeHidden? createDynamicNaiveBayesWithHidden(data0.getAttributes()): createDynamicNaiveBayes(data0.getAttributes()); System.out.println(NBdag.toString()); int nsets = 3; long start = System.nanoTime(); DynamicParallelVB parallelVB = new DynamicParallelVB(); parallelVB.setGlobalThreshold(0.1); parallelVB.setMaximumGlobalIterations(10); parallelVB.setLocalThreshold(0.1); parallelVB.setMaximumLocalIterations(100); parallelVB.setSeed(5); parallelVB.setOutput(true); parallelVB.setBatchSize(500); parallelVB.setDAG(NBdag); parallelVB.initLearning(); System.out.println("--------------- DATA " + 0 + " --------------------------"); parallelVB.updateModelWithNewTimeSlice(0, data0); for (int i = 1; i < nsets; i++) { logger.info("--------------- DATA " + i + " --------------------------"); DataFlink<DynamicDataInstance> dataNew = DataFlinkLoader.loadDynamicDataFromFolder(env, fileName+i+".arff", false); parallelVB.updateModelWithNewTimeSlice(i, dataNew); } long duration = (System.nanoTime() - start) / 1; double seconds = duration / 1000000000.0; System.out.printf("Running time: "+seconds+ "seconds"); }  static DynamicDAG createDynamicNaiveBayes(Attributes attributes); static DynamicDAG createDynamicNaiveBayesWithHidden(Attributes attributes); static void main(String[] args);  }