private void generateHeader() { ArrayList<String> classLabels = new ArrayList(); for (int i = 0; i < 2; i++) { classLabels.add("class" + (i + 1)); } ArrayList<Attribute> attributes = new ArrayList(); for (int i = 0; i < this.numAttsOption.getValue(); i++) { attributes.add(new Attribute("att" + (i + 1), classLabels)); } attributes.add(new Attribute("class", classLabels)); this.streamHeader = new InstancesHeader(new Instances( getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); }
protected void generateHeader() { // 2013/06/02: Noise label ArrayList<Attribute> attributes = new ArrayList<Attribute>(); for (int i = 0; i < this.numAttsOption.getValue(); i++) { attributes.add(new Attribute("att" + (i + 1))); } ArrayList<String> classLabels = new ArrayList<String>(); for (int i = 0; i < this.numClusterOption.getValue(); i++) { classLabels.add("class" + (i + 1)); } if (noiseLevelOption.getValue() > 0) classLabels.add("noise"); // The last label = "noise" attributes.add(new Attribute("class", classLabels)); streamHeader = new InstancesHeader(new Instances(getCLICreationString(InstanceStream.class), attributes, 0)); streamHeader.setClassIndex(streamHeader.numAttributes() - 1); }
protected void generateHeader() { // 2013/06/02: Noise label ArrayList<Attribute> attributes = new ArrayList<Attribute>(); for (int i = 0; i < this.numAttsOption.getValue(); i++) { attributes.add(new Attribute("att" + (i + 1))); } ArrayList<String> classLabels = new ArrayList<String>(); for (int i = 0; i < this.numClusterOption.getValue(); i++) { classLabels.add("class" + (i + 1)); } if (noiseLevelOption.getValue() > 0) classLabels.add("noise"); // The last label = "noise" attributes.add(new Attribute("class", classLabels)); streamHeader = new InstancesHeader(new Instances(getCLICreationString(InstanceStream.class), attributes, 0)); streamHeader.setClassIndex(streamHeader.numAttributes() - 1); }
protected void generateHeader() { // 2013/06/02: Noise label ArrayList<Attribute> attributes = new ArrayList<Attribute>(); for (int i = 0; i < this.numAttsOption.getValue(); i++) { attributes.add(new Attribute("att" + (i + 1))); } ArrayList<String> classLabels = new ArrayList<String>(); for (int i = 0; i < this.numClusterOption.getValue(); i++) { classLabels.add("class" + (i + 1)); } if (noiseLevelOption.getValue() > 0) classLabels.add("noise"); // The last label = "noise" attributes.add(new Attribute("class", classLabels)); streamHeader = new InstancesHeader(new Instances(getCLICreationString(InstanceStream.class), attributes, 0)); streamHeader.setClassIndex(streamHeader.numAttributes() - 1); }
this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); restart();
dataset.setClassIndex(h); System.out.println(""+dataset); System.out.println("classIndex : "+dataset.classIndex());
@Override protected void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository) { ArrayList<Attribute> attributes = new ArrayList(); int numAtts = 2; if (!this.suppressIrrelevantAttributesOption.isSet()) { numAtts += NUM_IRRELEVANT_ATTRIBUTES; } for (int i = 0; i < numAtts; i++) { attributes.add(new Attribute("att" + (i + 1))); } List classLabels = new ArrayList(); classLabels.add("positive"); classLabels.add("negative"); Attribute classAtt = new Attribute("class", classLabels); attributes.add(classAtt); this.streamHeader = new InstancesHeader(new Instances( getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); restart(); } }
@Override protected void prepareForUseImpl(TaskMonitor tm, ObjectRepository or) { classFunction = concepts[this.functionOption.getValue() - 1]; FastVector attributes = new FastVector(); attributes.addElement(new Attribute("color", Arrays.asList(colorValues))); attributes.addElement(new Attribute("price", Arrays.asList(priceValues))); attributes.addElement(new Attribute("payment", Arrays.asList(paymentValues))); attributes.addElement(new Attribute("amount", Arrays.asList(amountValues))); attributes.addElement(new Attribute("deliveryDelay", Arrays.asList(deliveryDelayValues))); this.instanceRandom = new Random(System.currentTimeMillis()); FastVector classLabels = new FastVector(); for (int i = 0; i < classValues.length; i++) { classLabels.addElement(classValues[i]); } attributes.addElement(new Attribute("class", classLabels)); this.streamHeader = new InstancesHeader(new Instances( getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); restart(); }
@SuppressWarnings({ "rawtypes", "unchecked" }) protected void generateHeader() { FastVector attributes = new FastVector(); for (int i = 0; i < this.numAttsOption.getValue(); i++) { attributes.addElement(new Attribute("att" + (i + 1))); } FastVector classLabels = new FastVector(); for (int i = 0; i < this.numClassesOption.getValue(); i++) { classLabels.addElement("class" + (i + 1)); } attributes.addElement(new Attribute("class", classLabels)); this.streamHeader = new InstancesHeader(new Instances(getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); }
@SuppressWarnings({ "rawtypes", "unchecked" }) protected void generateHeader() { FastVector attributes = new FastVector(); for (int i = 0; i < this.numAttsOption.getValue(); i++) { attributes.addElement(new Attribute("att" + (i + 1))); } FastVector classLabels = new FastVector(); for (int i = 0; i < this.numClassesOption.getValue(); i++) { classLabels.addElement("class" + (i + 1)); } attributes.addElement(new Attribute("class", classLabels)); this.streamHeader = new InstancesHeader(new Instances(getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); }
protected void generateHeader() { FastVector attributes = new FastVector(); for (int i = 0; i < this.numAttsOption.getValue(); i++) { attributes.addElement(new Attribute("att" + (i + 1))); } FastVector classLabels = new FastVector(); for (int i = 0; i < this.numClassesOption.getValue(); i++) { classLabels.addElement("class" + (i + 1)); } attributes.addElement(new Attribute("class", classLabels)); this.streamHeader = new InstancesHeader(new Instances( getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); }
protected void generateHeader() { FastVector attributes = new FastVector(); for (int i = 0; i < this.numAttsOption.getValue(); i++) { attributes.addElement(new Attribute("att" + (i + 1))); } FastVector classLabels = new FastVector(); for (int i = 0; i < this.numClassesOption.getValue(); i++) { classLabels.addElement("class" + (i + 1)); } attributes.addElement(new Attribute("class", classLabels)); this.streamHeader = new InstancesHeader(new Instances( getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); }
@Override protected void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository) { // generate header FastVector attributes = new FastVector(); FastVector binaryLabels = new FastVector(); binaryLabels.addElement("0"); binaryLabels.addElement("1"); int numAtts = 7; if (!this.suppressIrrelevantAttributesOption.isSet()) { numAtts += NUM_IRRELEVANT_ATTRIBUTES; } for (int i = 0; i < numAtts; i++) { attributes.addElement(new Attribute("att" + (i + 1), binaryLabels)); } FastVector classLabels = new FastVector(); for (int i = 0; i < 10; i++) { classLabels.addElement(Integer.toString(i)); } attributes.addElement(new Attribute("class", classLabels)); this.streamHeader = new InstancesHeader(new Instances( getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); restart(); }
@Override protected void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository) { // generate header FastVector attributes = new FastVector(); int numAtts = this.addNoiseOption.isSet() ? TOTAL_ATTRIBUTES_INCLUDING_NOISE : NUM_BASE_ATTRIBUTES; for (int i = 0; i < numAtts; i++) { attributes.addElement(new Attribute("att" + (i + 1))); } FastVector classLabels = new FastVector(); for (int i = 0; i < NUM_CLASSES; i++) { classLabels.addElement("class" + (i + 1)); } attributes.addElement(new Attribute("class", classLabels)); this.streamHeader = new InstancesHeader(new Instances( getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); restart(); }
@Override protected void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository) { restart(); this.numInstances = 0; this.period = numInstancesConceptOption.getValue(); // generate header FastVector attributes = new FastVector(); FastVector binaryLabels = new FastVector(); binaryLabels.addElement("0"); binaryLabels.addElement("1"); if (!this.notBinaryStreamOption.isSet()) { attributes.addElement(new Attribute("input", binaryLabels)); } else { attributes.addElement(new Attribute("input")); } // Ground Truth attributes.addElement(new Attribute("change", binaryLabels)); attributes.addElement(new Attribute("ground truth input")); this.streamHeader = new InstancesHeader(new Instances( getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); this.clusterEvents = new ArrayList<ClusterEvent>(); //this.clusterEvents.add(new ClusterEvent(this,100,"Change", "Drift")); //this.clusterEvents.add(new ClusterEvent(this,200,"Change2", "Drift2")); }
@Override protected void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository) { // generate header FastVector attributes = new FastVector(); attributes.addElement(new Attribute("attrib1")); attributes.addElement(new Attribute("attrib2")); attributes.addElement(new Attribute("attrib3")); FastVector classLabels = new FastVector(); classLabels.addElement("groupA"); classLabels.addElement("groupB"); attributes.addElement(new Attribute("class", classLabels)); this.streamHeader = new InstancesHeader(new Instances( getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); restart(); }
protected void generateHeader() { FastVector attributes = new FastVector(); FastVector nominalAttVals = new FastVector(); for (int i = 0; i < this.numValsPerNominalOption.getValue(); i++) { nominalAttVals.addElement("value" + (i + 1)); } for (int i = 0; i < this.numNominalsOption.getValue(); i++) { attributes.addElement(new Attribute("nominal" + (i + 1), nominalAttVals)); } for (int i = 0; i < this.numNumericsOption.getValue(); i++) { attributes.addElement(new Attribute("numeric" + (i + 1))); } FastVector classLabels = new FastVector(); for (int i = 0; i < this.numClassesOption.getValue(); i++) { classLabels.addElement("class" + (i + 1)); } attributes.addElement(new Attribute("class", classLabels)); this.streamHeader = new InstancesHeader(new Instances( getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); }
protected void generateHeader() { FastVector<Attribute> attributes = new FastVector<>(); FastVector<String> nominalAttVals = new FastVector<>(); for (int i = 0; i < this.numValsPerNominalOption.getValue(); i++) { nominalAttVals.addElement("value" + (i + 1)); } for (int i = 0; i < this.numNominalsOption.getValue(); i++) { attributes.addElement(new Attribute("nominal" + (i + 1), nominalAttVals)); } for (int i = 0; i < this.numNumericsOption.getValue(); i++) { attributes.addElement(new Attribute("numeric" + (i + 1))); } FastVector<String> classLabels = new FastVector<>(); for (int i = 0; i < this.numClassesOption.getValue(); i++) { classLabels.addElement("class" + (i + 1)); } attributes.addElement(new Attribute("class", classLabels)); this.streamHeader = new InstancesHeader(new Instances( getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); }
protected void generateHeader() { FastVector attributes = new FastVector(); FastVector nominalAttVals = new FastVector(); for (int i = 0; i < this.numValsPerNominalOption.getValue(); i++) { nominalAttVals.addElement("value" + (i + 1)); } for (int i = 0; i < this.numNominalsOption.getValue(); i++) { attributes.addElement(new Attribute("nominal" + (i + 1), nominalAttVals)); } for (int i = 0; i < this.numNumericsOption.getValue(); i++) { attributes.addElement(new Attribute("numeric" + (i + 1))); } FastVector classLabels = new FastVector(); for (int i = 0; i < this.numClassesOption.getValue(); i++) { classLabels.addElement("class" + (i + 1)); } attributes.addElement(new Attribute("class", classLabels)); this.streamHeader = new InstancesHeader(new Instances( getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); }
@Override protected void prepareForUseImpl(TaskMonitor monitor, ObjectRepository repository) { // generate header FastVector attributes = new FastVector(); FastVector sizeLabels = new FastVector(); sizeLabels.addElement("small"); sizeLabels.addElement("medium"); sizeLabels.addElement("large"); attributes.addElement(new Attribute("size", sizeLabels)); FastVector colorLabels = new FastVector(); colorLabels.addElement("red"); colorLabels.addElement("blue"); colorLabels.addElement("green"); attributes.addElement(new Attribute("color", colorLabels)); FastVector shapeLabels = new FastVector(); shapeLabels.addElement("circle"); shapeLabels.addElement("square"); shapeLabels.addElement("triangle"); attributes.addElement(new Attribute("shape", shapeLabels)); FastVector classLabels = new FastVector(); classLabels.addElement("false"); classLabels.addElement("true"); attributes.addElement(new Attribute("class", classLabels)); this.streamHeader = new InstancesHeader(new Instances( getCLICreationString(InstanceStream.class), attributes, 0)); this.streamHeader.setClassIndex(this.streamHeader.numAttributes() - 1); restart(); }