Class BalancedWinnow

    • Constructor Detail

      • BalancedWinnow

        public BalancedWinnow​(Pipe dataPipe,
                              double[][] weights)
        Passes along data pipe and weights from BalancedWinnowTrainer
        dataPipe - needed for dictionary, labels, feature vectors, etc
        weights - weights calculated during training phase
    • Method Detail

      • getWeights

        public double[][] getWeights()
        a copy of the weight vectors
      • classify

        public Classification classify​(Instance instance)
        Classifies an instance using BalancedWinnow's weights

        Returns a Classification containing the normalized dot products between class weight vectors and the instance feature vector.

        One can obtain the confidence of the classification by calculating weight(j')/weight(j), where j' is the highest weight prediction and j is the 2nd-highest. Another possibility is to calculate

        e^{dot(w_j', x} / sum_j[e^{dot(w_j, x)}]
        Specified by:
        classify in class Classifier