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

        if (m_weights == null) {
            return new double[inst.numClasses()];
        }
        double[] result = (inst.classAttribute().isNominal())
                ? new double[inst.numClasses()]
                : new double[1];
        
        if (inst.classAttribute().isNumeric()) {
            double wx = dotProd(inst, m_weights[0], inst.classIndex());// * m_wScale;
            double z = (wx + m_bias[0]);
            result[0] = z;
            return result;
        }

        for (int i = 0; i < m_weights.length; i++){
            double wx = dotProd(inst, m_weights[i], inst.classIndex());// * m_wScale;
            double z = (wx + m_bias[i]);
            if (z <= 0) {
                //  z = 0;
                if (m_loss == LOGLOSS) {
                    //result[0] = 1.0 / (1.0 + Math.exp(z));
                    //result[1] = 1.0 - result[0];
                    result[i] = 1.0 - 1.0 / (1.0 + Math.exp(z)); 
                } else {
                    //result[0] = 1;
                    result[i] = 0;
                }
            } else {
                if (m_loss == LOGLOSS) {
                    //result[1] = 1.0 / (1.0 + Math.exp(-z));
                    //result[0] = 1.0 - result[1];
                    result[i] = 1.0 / (1.0 + Math.exp(-z)); 
                } else {
                    //result[1] = 1;
                    result[i] = 1;
                }
            }
        }
        return result;
    }
@ Override public double [ ] getVotesForInstance ( Instance inst ) { if ( m_weights == null ) { return new double [ inst . numClasses ( ) ] ; } double [ ] result = ( inst . classAttribute ( ) . isNominal ( ) ) ? new double [ inst . numClasses ( ) ] : new double [ 1 ] ; if ( inst . classAttribute ( ) . isNumeric ( ) ) { double wx = dotProd ( inst , m_weights [ 0 ] , inst . classIndex ( ) ) ; double z = ( wx + m_bias [ 0 ] ) ; result [ 0 ] = z ; return result ; } for ( int i = 0 ; i < m_weights . length ; i ++ ) { double wx = dotProd ( inst , m_weights [ i ] , inst . classIndex ( ) ) ; double z = ( wx + m_bias [ i ] ) ; if ( z <= 0 ) { if ( m_loss == LOGLOSS ) { result [ i ] = 1.0 - 1.0 / ( 1.0 + Math . exp ( z ) ) ; } else { result [ i ] = 0 ; } } else { if ( m_loss == LOGLOSS ) { result [ i ] = 1.0 / ( 1.0 + Math . exp ( - z ) ) ; } else { result [ i ] = 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