public BitSet diversify(List<Subset> neighborhood){

    if(neighborhood == null)
      return m_Sbest.subset;

    BitSet result = new BitSet(m_numAttribs);

    double [] counts = new double[m_numAttribs];
    int numNeighborhood = neighborhood.size ();



    for (int i = 0; i < m_numAttribs; i++) {
      if(i == m_classIndex)
        continue;

      int counter = 0;

      for (int j = 0; j < numNeighborhood; j++) {
        if(((Subset)neighborhood.get (j)).subset.get (i))
          counter ++;
      }
      counts [i] = counter/(double)numNeighborhood;
    }

    for (int i = 0; i < m_numAttribs; i++) {
      double randomNumber = m_random.nextDouble ();
      double ocurrenceAndRank = counts [i] * (m_diversificationProb) + doubleRank (i) * (1 - m_diversificationProb);

      if(randomNumber > ocurrenceAndRank)
        result.set (i);
    }

    return result;
  }