use of com.amazon.randomcutforest.imputation.ConditionalSampleSummarizer in project random-cut-forest-by-aws by aws.
the class RandomCutForest method getConditionalFieldSummary.
public ConditionalSampleSummary getConditionalFieldSummary(float[] point, int numberOfMissingValues, int[] missingIndexes, double centrality) {
checkArgument(numberOfMissingValues >= 0, "cannot be negative");
checkNotNull(missingIndexes, "missingIndexes must not be null");
checkArgument(numberOfMissingValues <= missingIndexes.length, "numberOfMissingValues must be less than or equal to missingIndexes.length");
checkArgument(centrality >= 0 && centrality <= 1, "centrality needs to be in range [0,1]");
checkArgument(point != null, " cannot be null");
if (!isOutputReady()) {
return new ConditionalSampleSummary(dimensions);
}
int[] liftedIndices = transformIndices(missingIndexes, point.length);
ConditionalSampleSummarizer summarizer = new ConditionalSampleSummarizer(liftedIndices, transformToShingledPoint(point), centrality);
return summarizer.summarize(getConditionalField(point, numberOfMissingValues, missingIndexes, centrality));
}
Aggregations