@Test public void test() throws Exception { CreateCajamarDataContinuous.main(null); }
public static void main(String[] args) throws Exception{ int nContinuousAttributes=4; int nDiscreteAttributes=0; String names[] = {"SEQUENCE_ID", "TIME_ID","Income","Expenses","Balance","TotalCredit"}; String path = "datasets/simulated/"; int nSamples=1000; DataStream<DynamicDataInstance> data = DataSetGenerator.generate(1,1000,nDiscreteAttributes,nContinuousAttributes); List<Attribute> list = new ArrayList<Attribute>(); IntStream.range(0, data.getAttributes().getNumberOfAttributes()) .forEach(i -> { Attribute a = data.getAttributes().getFullListOfAttributes().get(i); StateSpaceType s = a.getStateSpaceType(); Attribute a2 = new Attribute(a.getIndex(), names[i],s); list.add(a2); }); Attributes att2 = new Attributes(list); List<DynamicDataInstance> listData = data.stream().collect(Collectors.toList()); DataStream<DynamicDataInstance> data2 = new DataOnMemoryListContainer<DynamicDataInstance>(att2,listData); DataStreamWriter.writeDataToFile(data2, path+"cajamar.arff"); Configuration conf = new Configuration(); conf.setInteger("taskmanager.network.numberOfBuffers", 12000); final ExecutionEnvironment env = ExecutionEnvironment.createLocalEnvironment(conf); env.getConfig().disableSysoutLogging(); env.setParallelism(Main.PARALLELISM); DataFlink<DataInstance> data2Flink = DataFlinkLoader.loadDataFromFile(env, path + "cajamar.arff", false); DataFlinkWriter.writeDataToARFFFolder(data2Flink, path+"cajamarDistributed.arff"); }
CreateCajamarDataContinuous { public static void main(String[] args) throws Exception{ int nContinuousAttributes=4; int nDiscreteAttributes=0; String names[] = {"SEQUENCE_ID", "TIME_ID","Income","Expenses","Balance","TotalCredit"}; String path = "datasets/simulated/"; int nSamples=1000; DataStream<DynamicDataInstance> data = DataSetGenerator.generate(1,1000,nDiscreteAttributes,nContinuousAttributes); List<Attribute> list = new ArrayList<Attribute>(); IntStream.range(0, data.getAttributes().getNumberOfAttributes()) .forEach(i -> { Attribute a = data.getAttributes().getFullListOfAttributes().get(i); StateSpaceType s = a.getStateSpaceType(); Attribute a2 = new Attribute(a.getIndex(), names[i],s); list.add(a2); }); Attributes att2 = new Attributes(list); List<DynamicDataInstance> listData = data.stream().collect(Collectors.toList()); DataStream<DynamicDataInstance> data2 = new DataOnMemoryListContainer<DynamicDataInstance>(att2,listData); DataStreamWriter.writeDataToFile(data2, path+"cajamar.arff"); Configuration conf = new Configuration(); conf.setInteger("taskmanager.network.numberOfBuffers", 12000); final ExecutionEnvironment env = ExecutionEnvironment.createLocalEnvironment(conf); env.getConfig().disableSysoutLogging(); env.setParallelism(Main.PARALLELISM); DataFlink<DataInstance> data2Flink = DataFlinkLoader.loadDataFromFile(env, path + "cajamar.arff", false); DataFlinkWriter.writeDataToARFFFolder(data2Flink, path+"cajamarDistributed.arff"); } }
CreateCajamarDataContinuous { public static void main(String[] args) throws Exception{ int nContinuousAttributes=4; int nDiscreteAttributes=0; String names[] = {"SEQUENCE_ID", "TIME_ID","Income","Expenses","Balance","TotalCredit"}; String path = "datasets/simulated/"; int nSamples=1000; DataStream<DynamicDataInstance> data = DataSetGenerator.generate(1,1000,nDiscreteAttributes,nContinuousAttributes); List<Attribute> list = new ArrayList<Attribute>(); IntStream.range(0, data.getAttributes().getNumberOfAttributes()) .forEach(i -> { Attribute a = data.getAttributes().getFullListOfAttributes().get(i); StateSpaceType s = a.getStateSpaceType(); Attribute a2 = new Attribute(a.getIndex(), names[i],s); list.add(a2); }); Attributes att2 = new Attributes(list); List<DynamicDataInstance> listData = data.stream().collect(Collectors.toList()); DataStream<DynamicDataInstance> data2 = new DataOnMemoryListContainer<DynamicDataInstance>(att2,listData); DataStreamWriter.writeDataToFile(data2, path+"cajamar.arff"); Configuration conf = new Configuration(); conf.setInteger("taskmanager.network.numberOfBuffers", 12000); final ExecutionEnvironment env = ExecutionEnvironment.createLocalEnvironment(conf); env.getConfig().disableSysoutLogging(); env.setParallelism(Main.PARALLELISM); DataFlink<DataInstance> data2Flink = DataFlinkLoader.loadDataFromFile(env, path + "cajamar.arff", false); DataFlinkWriter.writeDataToARFFFolder(data2Flink, path+"cajamarDistributed.arff"); }  }
CreateCajamarDataContinuous { public static void main(String[] args) throws Exception{ int nContinuousAttributes=4; int nDiscreteAttributes=0; String names[] = {"SEQUENCE_ID", "TIME_ID","Income","Expenses","Balance","TotalCredit"}; String path = "datasets/simulated/"; int nSamples=1000; DataStream<DynamicDataInstance> data = DataSetGenerator.generate(1,1000,nDiscreteAttributes,nContinuousAttributes); List<Attribute> list = new ArrayList<Attribute>(); IntStream.range(0, data.getAttributes().getNumberOfAttributes()) .forEach(i -> { Attribute a = data.getAttributes().getFullListOfAttributes().get(i); StateSpaceType s = a.getStateSpaceType(); Attribute a2 = new Attribute(a.getIndex(), names[i],s); list.add(a2); }); Attributes att2 = new Attributes(list); List<DynamicDataInstance> listData = data.stream().collect(Collectors.toList()); DataStream<DynamicDataInstance> data2 = new DataOnMemoryListContainer<DynamicDataInstance>(att2,listData); DataStreamWriter.writeDataToFile(data2, path+"cajamar.arff"); Configuration conf = new Configuration(); conf.setInteger("taskmanager.network.numberOfBuffers", 12000); final ExecutionEnvironment env = ExecutionEnvironment.createLocalEnvironment(conf); env.getConfig().disableSysoutLogging(); env.setParallelism(Main.PARALLELISM); DataFlink<DataInstance> data2Flink = DataFlinkLoader.loadDataFromFile(env, path + "cajamar.arff", false); DataFlinkWriter.writeDataToARFFFolder(data2Flink, path+"cajamarDistributed.arff"); }  static void main(String[] args); }
CreateCajamarDataContinuous { public static void main(String[] args) throws Exception{ int nContinuousAttributes=4; int nDiscreteAttributes=0; String names[] = {"SEQUENCE_ID", "TIME_ID","Income","Expenses","Balance","TotalCredit"}; String path = "datasets/simulated/"; int nSamples=1000; DataStream<DynamicDataInstance> data = DataSetGenerator.generate(1,1000,nDiscreteAttributes,nContinuousAttributes); List<Attribute> list = new ArrayList<Attribute>(); IntStream.range(0, data.getAttributes().getNumberOfAttributes()) .forEach(i -> { Attribute a = data.getAttributes().getFullListOfAttributes().get(i); StateSpaceType s = a.getStateSpaceType(); Attribute a2 = new Attribute(a.getIndex(), names[i],s); list.add(a2); }); Attributes att2 = new Attributes(list); List<DynamicDataInstance> listData = data.stream().collect(Collectors.toList()); DataStream<DynamicDataInstance> data2 = new DataOnMemoryListContainer<DynamicDataInstance>(att2,listData); DataStreamWriter.writeDataToFile(data2, path+"cajamar.arff"); Configuration conf = new Configuration(); conf.setInteger("taskmanager.network.numberOfBuffers", 12000); final ExecutionEnvironment env = ExecutionEnvironment.createLocalEnvironment(conf); env.getConfig().disableSysoutLogging(); env.setParallelism(Main.PARALLELISM); DataFlink<DataInstance> data2Flink = DataFlinkLoader.loadDataFromFile(env, path + "cajamar.arff", false); DataFlinkWriter.writeDataToARFFFolder(data2Flink, path+"cajamarDistributed.arff"); }  static void main(String[] args);  }