/** * Attribute. * * @param w the w * @return the attribute */ public Attribute attribute(int w) { return this.instanceInformation.attribute(w); }
public Attribute attribute(int w) { return this.instanceInformation.attribute(w); }
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) { // setClassValue(instance, valueAttribute); //} else { //instance.setValue(numAttribute, valueAttribute); indexValues.add(numAttribute); attributeValues.add(valueAttribute); //} //System.out.println(numAttribute+":"+valueAttribute+","+this.instanceInformation.classIndex()+","+value); }
public Attribute classAttribute() { return this.attribute(this.classIndex()); }
public Attribute classAttribute() { return this.attribute(this.classIndex()); }
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); } }
|| streamTokenizer.ttype == 34)) { boolean isNumeric = this.instanceInformation.attribute(numAttribute).isNumeric(); double value; if ("?".equals(streamTokenizer.sval)) { value = Double.valueOf(streamTokenizer.sval).doubleValue(); } else { value = this.instanceInformation.attribute(numAttribute).indexOfValue(streamTokenizer.sval);
value = Double.valueOf(streamTokenizer.sval).doubleValue(); } else { value = this.instanceInformation.attribute(numAttribute).indexOfValue(streamTokenizer.sval);
this.setSparseValue(instance, indexValues, attributeValues, numAttribute, Double.valueOf(streamTokenizer.sval).doubleValue(), true); } else { this.setSparseValue(instance, indexValues, attributeValues, numAttribute, this.instanceInformation.attribute(numAttribute).indexOfValue(streamTokenizer.sval), false);
this.setValue(instance, numAttribute, Double.valueOf(streamTokenizer.sval).doubleValue(), true); } else { this.setValue(instance, numAttribute, this.instanceInformation.attribute(numAttribute).indexOfValue(streamTokenizer.sval), false);
this.setValue(instance, numAttribute, Double.valueOf(streamTokenizer.sval).doubleValue(), true); } else { this.setValue(instance, numAttribute, this.instanceInformation.attribute(numAttribute).indexOfValue(streamTokenizer.sval), false);
this.setSparseValue(instance, indexValues, attributeValues, numAttribute, Double.valueOf(streamTokenizer.sval).doubleValue(), true); } else { this.setSparseValue(instance, indexValues, attributeValues, numAttribute, this.instanceInformation.attribute(numAttribute).indexOfValue(streamTokenizer.sval), false);