private double stopProbUsingBlend(){
  int itcount=0;
  double stopProb, aimfor;
  double lower, upper, tstop;
  KStarWrapper botvals=new KStarWrapper();
  KStarWrapper upvals=new KStarWrapper();
  KStarWrapper vals=new KStarWrapper();
  int testvalue=(int)m_Test.value(m_AttrIndex);
  aimfor=(m_TotalCount - m_Distribution[testvalue]) * (double)m_BlendFactor / 100.0 + m_Distribution[testvalue];
  tstop=1.0 - m_BlendFactor / 100.0;
  lower=0.0 + ROOT_FINDER_ACCURACY / 2.0;
  upper=1.0 - ROOT_FINDER_ACCURACY / 2.0;
  calculateSphereSize(testvalue,lower,botvals);
  botvals.sphere-=aimfor;
  calculateSphereSize(testvalue,upper,upvals);
  upvals.sphere-=aimfor;
  if (upvals.avgProb == 0) {
    calculateSphereSize(testvalue,tstop,vals);
  }
 else   if (upvals.sphere > 0) {
    tstop=upper;
    vals.avgProb=upvals.avgProb;
  }
 else {
    for (; ; ) {
      itcount++;
      calculateSphereSize(testvalue,tstop,vals);
      vals.sphere-=aimfor;
      if (Math.abs(vals.sphere) <= ROOT_FINDER_ACCURACY || itcount >= ROOT_FINDER_MAX_ITER) {
        break;
      }
      if (vals.sphere > 0.0) {
        lower=tstop;
        tstop=(upper + lower) / 2.0;
      }
 else {
        upper=tstop;
        tstop=(upper + lower) / 2.0;
      }
    }
  }
  m_SmallestProb=vals.minProb;
  m_AverageProb=vals.avgProb;
switch (m_MissingMode) {
case M_DELETE:
    m_MissingProb=0.0;
  break;
case M_NORMAL:
m_MissingProb=1.0;
break;
case M_MAXDIFF:
m_MissingProb=m_SmallestProb;
break;
case M_AVERAGE:
m_MissingProb=m_AverageProb;
break;
}
if (Math.abs(vals.avgProb - m_TotalCount) < EPSILON) {
stopProb=1.0;
}
 else {
stopProb=tstop;
}
return stopProb;
}

private double stopProbUsingBlend ( ) { int itcount = 0 ; double stopProb , aimfor ; double lower , upper , tstop ; KStarWrapper botvals = new KStarWrapper ( ) ; KStarWrapper upvals = new KStarWrapper ( ) ; KStarWrapper vals = new KStarWrapper ( ) ; int testvalue = ( int ) m_Test . value ( m_AttrIndex ) ; aimfor = ( m_TotalCount - m_Distribution [ testvalue ] ) * ( double ) m_BlendFactor / 100.0 + m_Distribution [ testvalue ] ; tstop = 1.0 - m_BlendFactor / 100.0 ; lower = 0.0 + ROOT_FINDER_ACCURACY / 2.0 ; upper = 1.0 - ROOT_FINDER_ACCURACY / 2.0 ; calculateSphereSize ( testvalue , lower , botvals ) ; botvals . sphere -= aimfor ; calculateSphereSize ( testvalue , upper , upvals ) ; upvals . sphere -= aimfor ; if ( upvals . avgProb == 0 ) { calculateSphereSize ( testvalue , tstop , vals ) ; } else if ( upvals . sphere > 0 ) { tstop = upper ; vals . avgProb = upvals . avgProb ; } else { for ( ; ; ) { itcount ++ ; calculateSphereSize ( testvalue , tstop , vals ) ; vals . sphere -= aimfor ; if ( Math . abs ( vals . sphere ) <= ROOT_FINDER_ACCURACY || itcount >= ROOT_FINDER_MAX_ITER ) { break ; } if ( vals . sphere > 0.0 ) { lower = tstop ; tstop = ( upper + lower ) / 2.0 ; } else { upper = tstop ; tstop = ( upper + lower ) / 2.0 ; } } } m_SmallestProb = vals . minProb ; m_AverageProb = vals . avgProb ; switch ( m_MissingMode ) { case M_DELETE : m_MissingProb = 0.0 ; break ; case M_NORMAL : m_MissingProb = 1.0 ; break ; case M_MAXDIFF : m_MissingProb = m_SmallestProb ; break ; case M_AVERAGE : m_MissingProb = m_AverageProb ; break ; } if ( Math . abs ( vals . avgProb - m_TotalCount ) < EPSILON ) { stopProb = 1.0 ; } else { stopProb = tstop ; } return stopProb ; }
calculates the " stop parameter " for this attribute using the blend method : the value is computed using a root finder algorithm . the method takes advantage of this calculation to compute the smallest and average transformation probabilities once the stop factor is obtained . it also sets the transformation probability to an attribute with a missing value .
