private double E(Instances inst,boolean change_weights) throws Exception {
  double loglk=0.0, sOW=0.0;
  for (int l=0; l < inst.numInstances(); l++) {
    Instance in=inst.instance(l);
    loglk+=in.weight() * logDensityForInstance(in);
    sOW+=in.weight();
    if (change_weights) {
      m_weights[l]=distributionForInstance(in);
    }
  }
  return loglk / sOW;
}

private double E ( Instances inst , boolean change_weights ) throws Exception { double loglk = 0.0 , sOW = 0.0 ; for ( int l = 0 ; l < inst . numInstances ( ) ; l ++ ) { Instance in = inst . instance ( l ) ; loglk += in . weight ( ) * logDensityForInstance ( in ) ; sOW += in . weight ( ) ; if ( change_weights ) { m_weights [ l ] = distributionForInstance ( in ) ; } } return loglk / sOW ; }
the e step of the em algorithm . estimate cluster membership probabilities .
