protected void computeLOFs(KNNQuery<O> knnq,DBIDs ids,DoubleDataStore lrds,WritableDoubleDataStore lofs,DoubleMinMax lofminmax){
  FiniteProgress progressLOFs=LOG.isVerbose() ? new FiniteProgress("LOF_SCORE for objects",ids.size(),LOG) : null;
  for (DBIDIter iter=ids.iter(); iter.valid(); iter.advance()) {
    final double lof;
    final double lrdp=lrds.doubleValue(iter);
    final KNNList neighbors=knnq.getKNNForDBID(iter,krefer);
    if (!Double.isInfinite(lrdp)) {
      double sum=0.;
      int count=0;
      for (DBIDIter neighbor=neighbors.iter(); neighbor.valid(); neighbor.advance()) {
        if (DBIDUtil.equal(neighbor,iter)) {
          continue;
        }
        final double val=lrds.doubleValue(neighbor);
        sum+=val;
        count++;
        if (Double.isInfinite(val)) {
          break;
        }
      }
      lof=sum / (lrdp * count);
    }
 else {
      lof=1.0;
    }
    lofs.putDouble(iter,lof);
    lofminmax.put(lof);
    LOG.incrementProcessed(progressLOFs);
  }
  LOG.ensureCompleted(progressLOFs);
}

protected void computeLOFs ( KNNQuery < O > knnq , DBIDs ids , DoubleDataStore lrds , WritableDoubleDataStore lofs , DoubleMinMax lofminmax ) { FiniteProgress progressLOFs = LOG . isVerbose ( ) ? new FiniteProgress ( "LOF_SCORE for objects" , ids . size ( ) , LOG ) : null ; for ( DBIDIter iter = ids . iter ( ) ; iter . valid ( ) ; iter . advance ( ) ) { final double lof ; final double lrdp = lrds . doubleValue ( iter ) ; final KNNList neighbors = knnq . getKNNForDBID ( iter , krefer ) ; if ( ! Double . isInfinite ( lrdp ) ) { double sum = 0. ; int count = 0 ; for ( DBIDIter neighbor = neighbors . iter ( ) ; neighbor . valid ( ) ; neighbor . advance ( ) ) { if ( DBIDUtil . equal ( neighbor , iter ) ) { continue ; } final double val = lrds . doubleValue ( neighbor ) ; sum += val ; count ++ ; if ( Double . isInfinite ( val ) ) { break ; } } lof = sum / ( lrdp * count ) ; } else { lof = 1.0 ; } lofs . putDouble ( iter , lof ) ; lofminmax . put ( lof ) ; LOG . incrementProcessed ( progressLOFs ) ; } LOG . ensureCompleted ( progressLOFs ) ; }
computes the local outlier factor ( lof ) of the specified objects .
