use of com.amazon.randomcutforest.interpolation.SimpleInterpolationVisitor in project random-cut-forest-by-aws by aws.
the class RandomCutForest method getSimpleDensity.
public DensityOutput getSimpleDensity(float[] point) {
if (!samplersFull()) {
return new DensityOutput(dimensions, sampleSize);
}
IVisitorFactory<InterpolationMeasure> visitorFactory = new VisitorFactory<>((tree, y) -> new SimpleInterpolationVisitor(tree.projectToTree(y), sampleSize, 1.0, centerOfMassEnabled), (tree, x) -> x.lift(tree::liftFromTree));
Collector<InterpolationMeasure, ?, InterpolationMeasure> collector = InterpolationMeasure.collector(dimensions, sampleSize, numberOfTrees);
return new DensityOutput(traverseForest(transformToShingledPoint(point), visitorFactory, collector));
}
Aggregations