/** * Class index. * * @return the int */ public int classIndex() { return this.instanceInformation.classIndex(); }
public int classIndex() { return this.instanceInformation.classIndex(); }
public Attribute classAttribute() { return this.attribute(this.classIndex()); }
public Attribute classAttribute() { return this.attribute(this.classIndex()); }
public int numClasses() { return this.attributes.get(this.classIndex()).numValues(); }
private void setClassValue(Instance instance, double valueAttribute) { instance.setValue(this.instanceInformation.classIndex(), valueAttribute); }
public int inputAttributeIndex(int index) { int ret = 0; if (classIndex == Integer.MAX_VALUE) {//Multi Label if(index<range.getStart())//JD ret= index; else ret= index+range.getSelectionLength(); } else { //Single Label ret = classIndex() > index ? index : index + 1; } return ret; }
public int numClasses() { return this.attributesInformation.attribute(classIndex()).numValues(); }
private void setSparseValue(Instance instance, List<Integer> indexValues, List<Double> attributeValues, int numAttribute, double value, boolean isNumber) { double valueAttribute; if (isNumber && this.instanceInformation.attribute(numAttribute).isNominal) { valueAttribute = this.instanceInformation.attribute(numAttribute).indexOfValue(Double.toString(value)); } else { valueAttribute = value; } if (this.instanceInformation.classIndex() == numAttribute) { instance.setClassValue(valueAttribute); } else { //instance.setValue(numAttribute, valueAttribute); indexValues.add(numAttribute); attributeValues.add(valueAttribute); } //System.out.println(numAttribute+":"+valueAttribute+","+this.instanceInformation.classIndex()+","+value); }
private void setValue(Instance instance, int numAttribute, double value, boolean isNumber) { double valueAttribute; if (isNumber && this.instanceInformation.attribute(numAttribute).isNominal) { valueAttribute = this.instanceInformation.attribute(numAttribute).indexOfValue(Double.toString(value)); //System.out.println(value +"/"+valueAttribute+" "); } else { valueAttribute = value; //System.out.println(value +"/"+valueAttribute+" "); } if (this.instanceInformation.classIndex() == numAttribute) { instance.setClassValue(valueAttribute); //System.out.println(value +"<"+this.instanceInformation.classIndex()+">"); } else { instance.setValue(numAttribute, valueAttribute); } }
protected void setValue(Instance instance, int numAttribute, double value, boolean isNumber) { double valueAttribute; if (isNumber && this.instanceInformation.attribute(numAttribute).isNominal) { valueAttribute = this.instanceInformation.attribute(numAttribute).indexOfValue(Double.toString(value)); //System.out.println(value +"/"+valueAttribute+" "); } else { valueAttribute = value; //System.out.println(value +"/"+valueAttribute+" "); } if (this.instanceInformation.classIndex() == numAttribute) { setClassValue(instance, valueAttribute); //System.out.println(value +"<"+this.instanceInformation.classIndex()+">"); } else { //if(numAttribute>this.instanceInformation.classIndex()) // numAttribute--; instance.setValue(numAttribute, valueAttribute); } }