}
// Label outlier result (reference)
{
OutlierResult bylabelresult = bylabel.run(database);
writeResult(fout, ids, bylabelresult, new IdentityScaling(), "bylabel");
}
// No/all outliers "results"
{
OutlierResult noresult = (new TrivialNoOutlier()).run(database);
writeResult(fout, ids, noresult, new IdentityScaling(), "no-outliers");
OutlierResult allresult = (new TrivialAllOutlier()).run(database);
writeResult(fout, ids, allresult, new IdentityScaling(), "all-outliers");
}
// KNN
logger.verbose("Running KNN");
runForEachK(new AlgRunner() {
@Override
public void run(int k, String kstr) {
KNNOutlier<O, D> knn = new KNNOutlier<O, D>(distf, k);
OutlierResult knnresult = knn.run(database, relation);
// Setup scaling
StandardDeviationScaling scaling = new StandardDeviationScaling();
scaling.prepare(knnresult);
writeResult(fout, ids, knnresult, scaling, "KNN-" + kstr);
detachResult(database, knnresult);
}
});
// KNN Weight
logger.verbose("Running KNNweight");
runForEachK(new AlgRunner() {
@Override
public void run(int k, String kstr) {
KNNWeightOutlier<O, D> knnw = new KNNWeightOutlier<O, D>(distf, k);
OutlierResult knnresult = knnw.run(database, relation);
// Setup scaling
StandardDeviationScaling scaling = new StandardDeviationScaling();
scaling.prepare(knnresult);
writeResult(fout, ids, knnresult, scaling, "KNNW-" + kstr);
detachResult(database, knnresult);
}
});
// Run LOF
logger.verbose("Running LOF");
runForEachK(new AlgRunner() {
@Override
public void run(int k, String kstr) {
LOF<O, D> lof = new LOF<O, D>(k, distf, distf);
OutlierResult lofresult = lof.run(relation);
// Setup scaling
StandardDeviationScaling scaling = new StandardDeviationScaling(1.0, 1.0);
scaling.prepare(lofresult);
writeResult(fout, ids, lofresult, scaling, "LOF-" + kstr);
detachResult(database, lofresult);
}
});
// LoOP
logger.verbose("Running LoOP");
runForEachK(new AlgRunner() {
@Override
public void run(int k, String kstr) {
LoOP<O, D> loop = new LoOP<O, D>(k, k, distf, distf, 1.0);
OutlierResult loopresult = loop.run(database, relation);
writeResult(fout, ids, loopresult, new IdentityScaling(), "LOOP-" + kstr);
detachResult(database, loopresult);
}
});
// LDOF
logger.verbose("Running LDOF");