wekaInstance.setValue(instanceId.index(), entry.getKey() .doubleValue()); wekaInstance.setValue(classAttr.index(), classAttr.indexOfValue(entry.getValue())); .entrySet()) { Attribute wordAttr = instances.attribute(word.getKey()); wekaInstance.setValue(wordAttr.index(), word.getValue() .doubleValue()); throw new IOException("oops! " + word); wekaInstance.setValue(wordAttr.index(), valueIndex);
inst.setValue(length, 5.3); inst.setValue(weight, 300); inst.setValue(position, "first"); inst.setValue(i, 1); copy.setMissing(length); System.out.println("Copy with length set to be missing: " + copy); copy.setValue(0, 0); System.out.println("Copy with first attribute set to 0: " + copy); copy.setValue(weight, 1); System.out.println("Copy with weight attribute set to 1: " + copy); copy.setValue(position, "second"); System.out.println("Copy with position set to \"second\": " + copy); copy.setValue(2, "first"); System.out.println("Copy with last attribute set to \"first\": " + copy); System.out.println("Current weight of instance copy: " + copy.weight());
wekaInstance.setValue(instanceId.index(), entry.getKey() .doubleValue()); wekaInstance.setValue(classAttr.index(), classAttr.indexOfValue(entry.getValue())); .entrySet()) { Attribute wordAttr = instances.attribute(word.getKey()); wekaInstance.setValue(wordAttr.index(), word.getValue() .doubleValue()); throw new IOException("oops! " + word); wekaInstance.setValue(wordAttr.index(), valueIndex);
inst.setValue(length, 5.3); inst.setValue(weight, 300); inst.setValue(position, "first"); inst.setValue(i, 1); copy.setMissing(length); System.out.println("Copy with length set to be missing: " + copy); copy.setValue(0, 0); System.out.println("Copy with first attribute set to 0: " + copy); copy.setValue(weight, 1); System.out.println("Copy with weight attribute set to 1: " + copy); copy.setValue(position, "second"); System.out.println("Copy with position set to \"second\": " + copy); copy.setValue(2, "first"); System.out.println("Copy with last attribute set to \"first\": " + copy); System.out.println("Current weight of instance copy: " + copy.weight());
instance.setValue(attribute, attributeValue); } else if (featureValue instanceof Boolean) { double attributeValue = (Boolean) featureValue ? 1.0d : -1.0d; instance.setValue(attribute, attributeValue); } else { instance.setValue(attribute, featureValue.toString()); instance.setValue(outcomeAttribute, instanceOutcomes.get(i)); instances.add(instance);
instance.setValue(attribute, attributeValue); } else if (featureValue instanceof Boolean) { double attributeValue = (Boolean) featureValue ? 1.0d : -1.0d; instance.setValue(attribute, attributeValue); } else { instance.setValue(attribute, featureValue.toString()); instance.setValue(outcomeAttribute, instanceOutcomes.get(i)); instances.add(instance);
copy.setMissing(length); System.out.println("Copy with length set to be missing: " + copy); copy.setValue(0, 0); System.out.println("Copy with first attribute set to 0: " + copy); copy.setValue(weight, 1); System.out.println("Copy with weight attribute set to 1: " + copy); copy.setValue(position, "second"); System.out.println("Copy with position set to \"second\": " + copy); copy.setValue(2, "first"); System.out.println("Copy with last attribute set to \"first\": " + copy); System.out.println("Current weight of instance copy: " + copy.weight());
copy.setMissing(length); System.out.println("Copy with length set to be missing: " + copy); copy.setValue(0, 0); System.out.println("Copy with first attribute set to 0: " + copy); copy.setValue(weight, 1); System.out.println("Copy with weight attribute set to 1: " + copy); copy.setValue(position, "second"); System.out.println("Copy with position set to \"second\": " + copy); copy.setValue(2, "first"); System.out.println("Copy with last attribute set to \"first\": " + copy); System.out.println("Current weight of instance copy: " + copy.weight());