All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.etsy.conjecture.data.BinaryLabeledInstance Maven / Gradle / Ivy

There is a newer version: 0.2.3
Show newest version
package com.etsy.conjecture.data;

import java.util.Map;

/**
 * TODO: when using method string all methods return a RealValueLabeledInstance
 * think about how to avoid this while not using generic types
 */
public class BinaryLabeledInstance extends
        AbstractInstance implements
        LabeledInstance {

    protected BinaryLabel label;

    public BinaryLabel getLabel() {
        return label;
    }

    public BinaryLabeledInstance() {
        this(new BinaryLabel(0.0), 1.0);
    }

    public BinaryLabeledInstance(double label, Map instance) {
        this(new BinaryLabel(label), instance, 1.0);
    }

    public BinaryLabeledInstance(double label, Map instance,
            double weight) {
        this(new BinaryLabel(label), instance, weight);
    }

    public BinaryLabeledInstance(double label, StringKeyedVector vec) {
        this(new BinaryLabel(label), vec.getMap(), 1.0);
    }

    public BinaryLabeledInstance(double label, StringKeyedVector vec,
            double weight) {
        this(new BinaryLabel(label), vec.getMap(), weight);
    }

    public BinaryLabeledInstance(BinaryLabel label, Map instance) {
        this(label, instance, 1.0);
    }

    public BinaryLabeledInstance(BinaryLabel label,
            Map instance, double weight) {
        super(instance, weight);
        this.label = label;
    }

    public BinaryLabeledInstance(BinaryLabel label, StringKeyedVector vec) {
        this(label, vec.getMap(), 1.0);
    }

    public BinaryLabeledInstance(BinaryLabel label, StringKeyedVector vec,
            double weight) {
        this(label, vec.getMap(), weight);
    }

    public BinaryLabeledInstance(double label) {
        this(new BinaryLabel(label), 1.0);
    }

    public BinaryLabeledInstance(double label, double weight) {
        this(new BinaryLabel(label), weight);
    }

    public BinaryLabeledInstance(BinaryLabel label) {
        this(label, 1.0);
    }

    public BinaryLabeledInstance(BinaryLabel label, double weight) {
        super(weight);
        this.label = label;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy