package io.disassemble.knn.feature;

/**
 * @author Tyler Sedlar
 * @since 5/17/16
 */
public class BooleanFeature extends IntegerFeature {

    public BooleanFeature(String key, boolean value) {
        super(key, value ? 1 : 0, 1F);
    }

    @Override
    public double distanceTo(Feature<Integer> feature) {
        return (value - feature.value);
    }
}

@@ -185,16 +185,31 @@
 an value
+, double weight
 ) %7B%0A    
@@ -242,10 +242,106 @@
  0, 
-1F
+weight);%0A    %7D%0A%0A    public BooleanFeature(String key, boolean value) %7B%0A        this(key, value, 1D
 );%0A 

Add weight to BooleanFeature