@Override
    public double[] getVotesForInstance(Instance inst) {

        if (m_weights == null) {
            return new double[inst.numAttributes() + 1];
        }

        double[] result = new double[2];

        double wx = dotProd(inst, m_weights, inst.classIndex());// * m_wScale;
        double z = (wx + m_weights[m_weights.length - 1]);
        //System.out.print("" + z + ": ");
        // System.out.println(1.0 / (1.0 + Math.exp(-z)));
        if (z <= 0) {
            //  z = 0;
            if (m_loss == LOGLOSS) {
                result[0] = 1.0 / (1.0 + Math.exp(z));
                result[1] = 1.0 - result[0];
            } else {
                result[0] = 1;
            }
        } else {
            if (m_loss == LOGLOSS) {
                result[1] = 1.0 / (1.0 + Math.exp(-z));
                result[0] = 1.0 - result[1];
            } else {
                result[1] = 1;
            }
        }
        return result;
    }
@ Override public double [ ] getVotesForInstance ( Instance inst ) { if ( m_weights == null ) { return new double [ inst . numAttributes ( ) + 1 ] ; } double [ ] result = new double [ 2 ] ; double wx = dotProd ( inst , m_weights , inst . classIndex ( ) ) ; double z = ( wx + m_weights [ m_weights . length - 1 ] ) ; if ( z <= 0 ) { if ( m_loss == LOGLOSS ) { result [ 0 ] = 1.0 / ( 1.0 + Math . exp ( z ) ) ; result [ 1 ] = 1.0 - result [ 0 ] ; } else { result [ 0 ] = 1 ; } } else { if ( m_loss == LOGLOSS ) { result [ 1 ] = 1.0 / ( 1.0 + Math . exp ( - z ) ) ; result [ 0 ] = 1.0 - result [ 1 ] ; } else { result [ 1 ] = 1 ; } } return result ; }
Calculates the class membership probabilities for the given test
instance.

@param instance the instance to be classified
@return predicted class probability distribution