public OutlierResult run(Database database, Relation<V> relationx, Relation<? extends NumberVector> relationy) {
    WritableDoubleDataStore scores = DataStoreUtil.makeDoubleStorage(relationx.getDBIDs(), DataStoreFactory.HINT_STATIC);
    DoubleMinMax mm = new DoubleMinMax(0.0, 0.0);

    // Outlier detection loop
    {
      ModifiableDBIDs idview = DBIDUtil.newHashSet(relationx.getDBIDs());
      ProxyView<V> proxy = new ProxyView<>(idview, relationx);

      double phialpha = NormalDistribution.standardNormalQuantile(1.0 - alpha * .5);
      // Detect outliers while significant.
      while(true) {
        Pair<DBIDVar, Double> candidate = singleIteration(proxy, relationy);
        if(candidate.second < phialpha) {
          break;
        }
        scores.putDouble(candidate.first, candidate.second);
        if(!Double.isNaN(candidate.second)) {
          mm.put(candidate.second);
        }
        idview.remove(candidate.first);
      }

      // Remaining objects are inliers
      for(DBIDIter iter = idview.iter(); iter.valid(); iter.advance()) {
        scores.putDouble(iter, 0.0);
      }
    }

    DoubleRelation scoreResult = new MaterializedDoubleRelation("GLSSODBackward", "GLSSODbackward-outlier", scores, relationx.getDBIDs());
    OutlierScoreMeta scoreMeta = new BasicOutlierScoreMeta(mm.getMin(), mm.getMax(), 0, Double.POSITIVE_INFINITY, 0);
    return new OutlierResult(scoreMeta, scoreResult);
  }
public OutlierResult run ( Database database , Relation < V > relationx , Relation < ? extends NumberVector > relationy ) { WritableDoubleDataStore scores = DataStoreUtil . makeDoubleStorage ( relationx . getDBIDs ( ) , DataStoreFactory . HINT_STATIC ) ; DoubleMinMax mm = new DoubleMinMax ( 0.0 , 0.0 ) ; { ModifiableDBIDs idview = DBIDUtil . newHashSet ( relationx . getDBIDs ( ) ) ; ProxyView < V > proxy = new ProxyView < > ( idview , relationx ) ; double phialpha = NormalDistribution . standardNormalQuantile ( 1.0 - alpha * .5 ) ; while ( true ) { Pair < DBIDVar , Double > candidate = singleIteration ( proxy , relationy ) ; if ( candidate . second < phialpha ) { break ; } scores . putDouble ( candidate . first , candidate . second ) ; if ( ! Double . isNaN ( candidate . second ) ) { mm . put ( candidate . second ) ; } idview . remove ( candidate . first ) ; } for ( DBIDIter iter = idview . iter ( ) ; iter . valid ( ) ; iter . advance ( ) ) { scores . putDouble ( iter , 0.0 ) ; } } DoubleRelation scoreResult = new MaterializedDoubleRelation ( "GLSSODBackward" , "GLSSODbackward-outlier" , scores , relationx . getDBIDs ( ) ) ; OutlierScoreMeta scoreMeta = new BasicOutlierScoreMeta ( mm . getMin ( ) , mm . getMax ( ) , 0 , Double . POSITIVE_INFINITY , 0 ) ; return new OutlierResult ( scoreMeta , scoreResult ) ; }
Run the algorithm

@param database Database to process
@param relationx Spatial relation
@param relationy Attribute relation
@return Algorithm result