@Override public double evaluateSubset(BitSet subset) throws Exception {
  double num=0.0;
  double denom=0.0;
  float corr;
  int larger, smaller;
  for (int i=0; i < m_numAttribs; i++) {
    if (i != m_classIndex) {
      if (subset.get(i)) {
        if (i > m_classIndex) {
          larger=i;
          smaller=m_classIndex;
        }
 else {
          smaller=i;
          larger=m_classIndex;
        }
        if (m_corr_matrix[larger][smaller] == -999) {
          corr=correlate(i,m_classIndex);
          m_corr_matrix[larger][smaller]=corr;
          num+=(m_std_devs[i] * corr);
        }
 else {
          num+=(m_std_devs[i] * m_corr_matrix[larger][smaller]);
        }
      }
    }
  }
  for (int i=0; i < m_numAttribs; i++) {
    if (i != m_classIndex) {
      if (subset.get(i)) {
        denom+=(1.0 * m_std_devs[i] * m_std_devs[i]);
        for (int j=0; j < m_corr_matrix[i].length - 1; j++) {
          if (subset.get(j)) {
            if (m_corr_matrix[i][j] == -999) {
              corr=correlate(i,j);
              m_corr_matrix[i][j]=corr;
              denom+=(2.0 * m_std_devs[i] * m_std_devs[j]* corr);
            }
 else {
              denom+=(2.0 * m_std_devs[i] * m_std_devs[j]* m_corr_matrix[i][j]);
            }
          }
        }
      }
    }
  }
  if (denom < 0.0) {
    denom*=-1.0;
  }
  if (denom == 0.0) {
    return (0.0);
  }
  double merit=(num / Math.sqrt(denom));
  if (merit < 0.0) {
    merit*=-1.0;
  }
  return merit;
}

@ Override public double evaluateSubset ( BitSet subset ) throws Exception { double num = 0.0 ; double denom = 0.0 ; float corr ; int larger , smaller ; for ( int i = 0 ; i < m_numAttribs ; i ++ ) { if ( i != m_classIndex ) { if ( subset . get ( i ) ) { if ( i > m_classIndex ) { larger = i ; smaller = m_classIndex ; } else { smaller = i ; larger = m_classIndex ; } if ( m_corr_matrix [ larger ] [ smaller ] == - 999 ) { corr = correlate ( i , m_classIndex ) ; m_corr_matrix [ larger ] [ smaller ] = corr ; num += ( m_std_devs [ i ] * corr ) ; } else { num += ( m_std_devs [ i ] * m_corr_matrix [ larger ] [ smaller ] ) ; } } } } for ( int i = 0 ; i < m_numAttribs ; i ++ ) { if ( i != m_classIndex ) { if ( subset . get ( i ) ) { denom += ( 1.0 * m_std_devs [ i ] * m_std_devs [ i ] ) ; for ( int j = 0 ; j < m_corr_matrix [ i ] . length - 1 ; j ++ ) { if ( subset . get ( j ) ) { if ( m_corr_matrix [ i ] [ j ] == - 999 ) { corr = correlate ( i , j ) ; m_corr_matrix [ i ] [ j ] = corr ; denom += ( 2.0 * m_std_devs [ i ] * m_std_devs [ j ] * corr ) ; } else { denom += ( 2.0 * m_std_devs [ i ] * m_std_devs [ j ] * m_corr_matrix [ i ] [ j ] ) ; } } } } } } if ( denom < 0.0 ) { denom *= - 1.0 ; } if ( denom == 0.0 ) { return ( 0.0 ) ; } double merit = ( num / Math . sqrt ( denom ) ) ; if ( merit < 0.0 ) { merit *= - 1.0 ; } return merit ; }
evaluates a subset of attributes
