Full Code of aws/random-cut-forest-by-aws for AI

main 2486241c914d cached
391 files
8.9 MB
2.4M tokens
3627 symbols
1 requests
Download .txt
Showing preview only (9,410K chars total). Download the full file or copy to clipboard to get everything.
Repository: aws/random-cut-forest-by-aws
Branch: main
Commit: 2486241c914d
Files: 391
Total size: 8.9 MB

Directory structure:
gitextract_acgcjc4v/

├── .github/
│   ├── draft-release-notes-config.yml
│   └── workflows/
│       ├── draft-release-notes-workflow.yml
│       ├── maven-release.yml
│       ├── maven-snapshot.yml
│       ├── maven.yml
│       └── rust.yml
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Java/
│   ├── README.md
│   ├── RELEASING.md
│   ├── benchmark/
│   │   ├── pom.xml
│   │   └── src/
│   │       └── main/
│   │           └── java/
│   │               └── com/
│   │                   └── amazon/
│   │                       └── randomcutforest/
│   │                           ├── RandomCutForestBenchmark.java
│   │                           ├── RandomCutForestShingledBenchmark.java
│   │                           ├── StateMapperBenchmark.java
│   │                           ├── StateMapperShingledBenchmark.java
│   │                           └── profilers/
│   │                               ├── ObjectGraphSizeProfiler.java
│   │                               └── OutputSizeProfiler.java
│   ├── core/
│   │   ├── pom.xml
│   │   └── src/
│   │       ├── main/
│   │       │   └── java/
│   │       │       └── com/
│   │       │           └── amazon/
│   │       │               └── randomcutforest/
│   │       │                   ├── CommonUtils.java
│   │       │                   ├── ComponentList.java
│   │       │                   ├── IComponentModel.java
│   │       │                   ├── IMultiVisitorFactory.java
│   │       │                   ├── IVisitorFactory.java
│   │       │                   ├── MultiVisitor.java
│   │       │                   ├── MultiVisitorFactory.java
│   │       │                   ├── PredictiveRandomCutForest.java
│   │       │                   ├── RandomCutForest.java
│   │       │                   ├── Visitor.java
│   │       │                   ├── VisitorFactory.java
│   │       │                   ├── anomalydetection/
│   │       │                   │   ├── AbstractAttributionVisitor.java
│   │       │                   │   ├── AbstractScalarScoreVisitor.java
│   │       │                   │   ├── AnomalyAttributionVisitor.java
│   │       │                   │   ├── AnomalyScoreVisitor.java
│   │       │                   │   ├── DynamicAttributionVisitor.java
│   │       │                   │   ├── DynamicScoreVisitor.java
│   │       │                   │   ├── SimulatedTransductiveScalarScoreVisitor.java
│   │       │                   │   └── TransductiveScalarScoreVisitor.java
│   │       │                   ├── config/
│   │       │                   │   ├── Config.java
│   │       │                   │   ├── ForestMode.java
│   │       │                   │   ├── IDynamicConfig.java
│   │       │                   │   ├── ImputationMethod.java
│   │       │                   │   ├── Precision.java
│   │       │                   │   └── TransformMethod.java
│   │       │                   ├── executor/
│   │       │                   │   ├── AbstractForestTraversalExecutor.java
│   │       │                   │   ├── AbstractForestUpdateExecutor.java
│   │       │                   │   ├── AbstractUpdateCoordinator.java
│   │       │                   │   ├── IStateCoordinator.java
│   │       │                   │   ├── ITraversable.java
│   │       │                   │   ├── IUpdatable.java
│   │       │                   │   ├── ParallelForestTraversalExecutor.java
│   │       │                   │   ├── ParallelForestUpdateExecutor.java
│   │       │                   │   ├── PointStoreCoordinator.java
│   │       │                   │   ├── SamplerPlusTree.java
│   │       │                   │   ├── SequentialForestTraversalExecutor.java
│   │       │                   │   ├── SequentialForestUpdateExecutor.java
│   │       │                   │   └── UpdateResult.java
│   │       │                   ├── imputation/
│   │       │                   │   ├── ConditionalSampleSummarizer.java
│   │       │                   │   └── ImputeVisitor.java
│   │       │                   ├── inputtypes/
│   │       │                   │   └── Point.java
│   │       │                   ├── inspect/
│   │       │                   │   └── NearNeighborVisitor.java
│   │       │                   ├── interpolation/
│   │       │                   │   └── SimpleInterpolationVisitor.java
│   │       │                   ├── preprocessor/
│   │       │                   │   ├── IPreprocessor.java
│   │       │                   │   ├── ImputePreprocessor.java
│   │       │                   │   ├── InitialSegmentPreprocessor.java
│   │       │                   │   ├── Preprocessor.java
│   │       │                   │   └── transform/
│   │       │                   │       ├── DifferenceTransformer.java
│   │       │                   │       ├── ITransformer.java
│   │       │                   │       ├── NormalizedDifferenceTransformer.java
│   │       │                   │       ├── NormalizedTransformer.java
│   │       │                   │       ├── SubtractMATransformer.java
│   │       │                   │       └── WeightedTransformer.java
│   │       │                   ├── returntypes/
│   │       │                   │   ├── ConditionalTreeSample.java
│   │       │                   │   ├── ConvergingAccumulator.java
│   │       │                   │   ├── DensityOutput.java
│   │       │                   │   ├── DiVector.java
│   │       │                   │   ├── InterpolationMeasure.java
│   │       │                   │   ├── Neighbor.java
│   │       │                   │   ├── OneSidedConvergingDiVectorAccumulator.java
│   │       │                   │   ├── OneSidedConvergingDoubleAccumulator.java
│   │       │                   │   ├── OneSidedStDevAccumulator.java
│   │       │                   │   ├── RangeVector.java
│   │       │                   │   ├── SampleSummary.java
│   │       │                   │   └── TimedRangeVector.java
│   │       │                   ├── runner/
│   │       │                   │   ├── AnomalyAttributionRunner.java
│   │       │                   │   ├── AnomalyScoreRunner.java
│   │       │                   │   ├── ArgumentParser.java
│   │       │                   │   ├── ImputeRunner.java
│   │       │                   │   ├── LineTransformer.java
│   │       │                   │   ├── SimpleDensityRunner.java
│   │       │                   │   ├── SimpleRunner.java
│   │       │                   │   └── UpdateOnlyTransformer.java
│   │       │                   ├── sampler/
│   │       │                   │   ├── AbstractStreamSampler.java
│   │       │                   │   ├── AcceptPointState.java
│   │       │                   │   ├── CompactSampler.java
│   │       │                   │   ├── ISampled.java
│   │       │                   │   ├── IStreamSampler.java
│   │       │                   │   └── Weighted.java
│   │       │                   ├── state/
│   │       │                   │   ├── ExecutionContext.java
│   │       │                   │   ├── IContextualStateMapper.java
│   │       │                   │   ├── IStateMapper.java
│   │       │                   │   ├── PredictiveRandomCutForestMapper.java
│   │       │                   │   ├── PredictiveRandomCutForestState.java
│   │       │                   │   ├── RandomCutForestMapper.java
│   │       │                   │   ├── RandomCutForestState.java
│   │       │                   │   ├── Version.java
│   │       │                   │   ├── preprocessor/
│   │       │                   │   │   ├── PreprocessorMapper.java
│   │       │                   │   │   └── PreprocessorState.java
│   │       │                   │   ├── returntypes/
│   │       │                   │   │   ├── DiVectorMapper.java
│   │       │                   │   │   └── DiVectorState.java
│   │       │                   │   ├── sampler/
│   │       │                   │   │   ├── CompactSamplerMapper.java
│   │       │                   │   │   └── CompactSamplerState.java
│   │       │                   │   ├── statistics/
│   │       │                   │   │   ├── DeviationMapper.java
│   │       │                   │   │   └── DeviationState.java
│   │       │                   │   ├── store/
│   │       │                   │   │   ├── NodeStoreState.java
│   │       │                   │   │   ├── PointStoreMapper.java
│   │       │                   │   │   └── PointStoreState.java
│   │       │                   │   └── tree/
│   │       │                   │       ├── AbstractNodeStoreMapper.java
│   │       │                   │       ├── CompactRandomCutTreeContext.java
│   │       │                   │       ├── CompactRandomCutTreeState.java
│   │       │                   │       └── RandomCutTreeMapper.java
│   │       │                   ├── statistics/
│   │       │                   │   └── Deviation.java
│   │       │                   ├── store/
│   │       │                   │   ├── IPointStore.java
│   │       │                   │   ├── IPointStoreView.java
│   │       │                   │   ├── IndexIntervalManager.java
│   │       │                   │   ├── PointStore.java
│   │       │                   │   ├── PointStoreLarge.java
│   │       │                   │   ├── PointStoreSmall.java
│   │       │                   │   └── StreamSampler.java
│   │       │                   ├── summarization/
│   │       │                   │   ├── Center.java
│   │       │                   │   ├── GenericMultiCenter.java
│   │       │                   │   ├── ICluster.java
│   │       │                   │   ├── MultiCenter.java
│   │       │                   │   └── Summarizer.java
│   │       │                   ├── tree/
│   │       │                   │   ├── AbstractNodeStore.java
│   │       │                   │   ├── BoundingBox.java
│   │       │                   │   ├── Cut.java
│   │       │                   │   ├── HyperTree.java
│   │       │                   │   ├── IBoundingBoxView.java
│   │       │                   │   ├── INodeView.java
│   │       │                   │   ├── ITree.java
│   │       │                   │   ├── NodeStoreLarge.java
│   │       │                   │   ├── NodeStoreMedium.java
│   │       │                   │   ├── NodeStoreSmall.java
│   │       │                   │   ├── NodeView.java
│   │       │                   │   └── RandomCutTree.java
│   │       │                   └── util/
│   │       │                       ├── ArrayPacking.java
│   │       │                       ├── ArrayUtils.java
│   │       │                       ├── ShingleBuilder.java
│   │       │                       └── Weighted.java
│   │       └── test/
│   │           ├── java/
│   │           │   └── com/
│   │           │       └── amazon/
│   │           │           └── randomcutforest/
│   │           │               ├── AttributionExamplesFunctionalTest.java
│   │           │               ├── CPUTest.java
│   │           │               ├── ConditionalFieldTest.java
│   │           │               ├── DynamicPointSetFunctionalTest.java
│   │           │               ├── ForecastTest.java
│   │           │               ├── MultiCenterTest.java
│   │           │               ├── PredictiveRandomCutForestTest.java
│   │           │               ├── RandomCutForestBuilderTest.java
│   │           │               ├── RandomCutForestConsistencyFunctionalTest.java
│   │           │               ├── RandomCutForestFunctionalTest.java
│   │           │               ├── RandomCutForestShingledFunctionalTest.java
│   │           │               ├── RandomCutForestTest.java
│   │           │               ├── SampleSummaryTest.java
│   │           │               ├── TestUtils.java
│   │           │               ├── anomalydetection/
│   │           │               │   ├── AnomalyAttributionVisitorTest.java
│   │           │               │   ├── AnomalyScoreVisitorTest.java
│   │           │               │   ├── DynamicAttributionVisitorTest.java
│   │           │               │   └── DynamicScoreVisitorTest.java
│   │           │               ├── executor/
│   │           │               │   ├── ForestTraversalExecutorTest.java
│   │           │               │   ├── ForestUpdateExecutorTest.java
│   │           │               │   ├── PointStoreCoordinatorTest.java
│   │           │               │   ├── SamplerPlusTreeTest.java
│   │           │               │   └── UpdateResultTest.java
│   │           │               ├── imputation/
│   │           │               │   ├── ConditionalSampleSummarizerTest.java
│   │           │               │   └── ImputeVisitorTest.java
│   │           │               ├── inspect/
│   │           │               │   └── NearNeighborVisitorTest.java
│   │           │               ├── interpolation/
│   │           │               │   └── SimpleInterpolationVisitorTest.java
│   │           │               ├── preprocessor/
│   │           │               │   ├── PreprocessorTest.java
│   │           │               │   └── transform/
│   │           │               │       └── WeightedTransformerTest.java
│   │           │               ├── returntypes/
│   │           │               │   ├── DensityOutputTest.java
│   │           │               │   ├── DiVectorTest.java
│   │           │               │   ├── InterpolationMeasureTest.java
│   │           │               │   ├── NeighborTest.java
│   │           │               │   ├── OneSidedConvergingDiVectorTest.java
│   │           │               │   ├── OneSidedConvergingDoubleAccumulatorTest.java
│   │           │               │   ├── RangeVectorTest.java
│   │           │               │   ├── SampleSummaryTest.java
│   │           │               │   └── TimedRangeVectorTest.java
│   │           │               ├── runner/
│   │           │               │   ├── AnomalyAttributionRunnerTest.java
│   │           │               │   ├── AnomalyScoreRunnerTest.java
│   │           │               │   ├── ArgumentParserTest.java
│   │           │               │   ├── ImputeRunnerTest.java
│   │           │               │   ├── SimpleDensityRunnerTest.java
│   │           │               │   └── UpdateOnlyTransformerTest.java
│   │           │               ├── sampler/
│   │           │               │   └── CompactSamplerTest.java
│   │           │               ├── state/
│   │           │               │   ├── RandomCutForestMapperTest.java
│   │           │               │   ├── V2PreProcessorJsonResource.java
│   │           │               │   ├── V2RCFJsonResource.java
│   │           │               │   ├── sampler/
│   │           │               │   │   └── CompactSamplerMapperTest.java
│   │           │               │   └── store/
│   │           │               │       └── PointStoreMapperTest.java
│   │           │               ├── statistics/
│   │           │               │   └── StatisticsTest.java
│   │           │               ├── store/
│   │           │               │   ├── PointStoreTest.java
│   │           │               │   └── StreamSamplerTest.java
│   │           │               ├── tree/
│   │           │               │   ├── BoundingBoxTest.java
│   │           │               │   ├── BoxCacheTest.java
│   │           │               │   ├── CutTest.java
│   │           │               │   ├── HyperTreeTest.java
│   │           │               │   └── RandomCutTreeTest.java
│   │           │               └── util/
│   │           │                   ├── ArrayPackingTest.java
│   │           │                   ├── ArrayUtilsTest.java
│   │           │                   ├── ShingleBuilderTest.java
│   │           │                   └── WeightedTest.java
│   │           └── resources/
│   │               └── com/
│   │                   └── amazon/
│   │                       └── randomcutforest/
│   │                           └── state/
│   │                               ├── Preprocessor_1.json
│   │                               ├── Preprocessor_2.json
│   │                               ├── Preprocessor_3.json
│   │                               ├── state_1.json
│   │                               ├── state_2.json
│   │                               └── state_3.json
│   ├── examples/
│   │   ├── pom.xml
│   │   └── src/
│   │       └── main/
│   │           └── java/
│   │               └── com/
│   │                   └── amazon/
│   │                       └── randomcutforest/
│   │                           └── examples/
│   │                               ├── Example.java
│   │                               ├── Main.java
│   │                               ├── dynamicconfiguration/
│   │                               │   ├── DynamicSampling.java
│   │                               │   └── DynamicThroughput.java
│   │                               ├── dynamicinference/
│   │                               │   ├── ConditionalPredictive.java
│   │                               │   ├── DynamicDensity.java
│   │                               │   └── DynamicNearNeighbor.java
│   │                               ├── parkservices/
│   │                               │   ├── ForecastWithLimits.java
│   │                               │   ├── LowNoisePeriodic.java
│   │                               │   ├── NumericGLADexample.java
│   │                               │   ├── RCFCasterExample.java
│   │                               │   ├── ScoringStrategyExample.java
│   │                               │   ├── SequentialAnomalyExample.java
│   │                               │   ├── SequentialForecastExample.java
│   │                               │   ├── StringGLADexample.java
│   │                               │   ├── Thresholded1DGaussianMix.java
│   │                               │   ├── ThresholdedForecast.java
│   │                               │   ├── ThresholdedImpute.java
│   │                               │   ├── ThresholdedInternalShinglingExample.java
│   │                               │   ├── ThresholdedMultiDimensionalExample.java
│   │                               │   ├── ThresholdedPredictive.java
│   │                               │   ├── ThresholdedRCFJsonExample.java
│   │                               │   └── ThresholdedTime.java
│   │                               ├── serialization/
│   │                               │   ├── JsonExample.java
│   │                               │   ├── ObjectStreamExample.java
│   │                               │   ├── ProtostuffExample.java
│   │                               │   ├── ProtostuffExampleWithDynamicLambda.java
│   │                               │   └── ProtostuffExampleWithShingles.java
│   │                               └── summarization/
│   │                                   ├── DynamicSummarization.java
│   │                                   ├── RCFMultiSummarizeExample.java
│   │                                   ├── RCFStringSummarizeExample.java
│   │                                   └── RCFSummarizeExample.java
│   ├── findbugs-filters.xml
│   ├── license-header
│   ├── lombok.config
│   ├── parkservices/
│   │   ├── pom.xml
│   │   └── src/
│   │       ├── main/
│   │       │   └── java/
│   │       │       └── com/
│   │       │           └── amazon/
│   │       │               └── randomcutforest/
│   │       │                   └── parkservices/
│   │       │                       ├── AnomalyDescriptor.java
│   │       │                       ├── ForecastDescriptor.java
│   │       │                       ├── GlobalLocalAnomalyDetector.java
│   │       │                       ├── PredictorCorrector.java
│   │       │                       ├── RCFCaster.java
│   │       │                       ├── SequentialAnalysis.java
│   │       │                       ├── ThresholdedRandomCutForest.java
│   │       │                       ├── calibration/
│   │       │                       │   └── ErrorHandler.java
│   │       │                       ├── config/
│   │       │                       │   ├── Calibration.java
│   │       │                       │   ├── CorrectionMode.java
│   │       │                       │   └── ScoringStrategy.java
│   │       │                       ├── returntypes/
│   │       │                       │   ├── AnalysisDescriptor.java
│   │       │                       │   ├── GenericAnomalyDescriptor.java
│   │       │                       │   └── RCFComputeDescriptor.java
│   │       │                       ├── state/
│   │       │                       │   ├── RCFCasterMapper.java
│   │       │                       │   ├── RCFCasterState.java
│   │       │                       │   ├── ThresholdedRandomCutForestMapper.java
│   │       │                       │   ├── ThresholdedRandomCutForestState.java
│   │       │                       │   ├── errorhandler/
│   │       │                       │   │   ├── ErrorHandlerMapper.java
│   │       │                       │   │   └── ErrorHandlerState.java
│   │       │                       │   ├── predictorcorrector/
│   │       │                       │   │   ├── PredictorCorrectorMapper.java
│   │       │                       │   │   └── PredictorCorrectorState.java
│   │       │                       │   ├── returntypes/
│   │       │                       │   │   ├── ComputeDescriptorMapper.java
│   │       │                       │   │   └── ComputeDescriptorState.java
│   │       │                       │   └── threshold/
│   │       │                       │       ├── BasicThresholderMapper.java
│   │       │                       │       └── BasicThresholderState.java
│   │       │                       └── threshold/
│   │       │                           └── BasicThresholder.java
│   │       └── test/
│   │           ├── java/
│   │           │   └── com/
│   │           │       └── amazon/
│   │           │           └── randomcutforest/
│   │           │               └── parkservices/
│   │           │                   ├── AnomalyDescriptorTest.java
│   │           │                   ├── ConsistencyTest.java
│   │           │                   ├── DescriptorTest.java
│   │           │                   ├── ForecastTest.java
│   │           │                   ├── IgnoreTest.java
│   │           │                   ├── MissingValueTest.java
│   │           │                   ├── PredictorCorrectorTest.java
│   │           │                   ├── RCFCasterTest.java
│   │           │                   ├── SequentialAnalysisTest.java
│   │           │                   ├── TestGlobalLocalAnomalyDetector.java
│   │           │                   ├── ThresholdedRandomCutForestTest.java
│   │           │                   ├── TransformTest.java
│   │           │                   ├── calibration/
│   │           │                   │   └── ErrorHandlerTest.java
│   │           │                   ├── state/
│   │           │                   │   ├── RCFCasterMapperTest.java
│   │           │                   │   ├── ThresholdedRandomCutForestMapperTest.java
│   │           │                   │   ├── V2TRCFByteBase64Resource.java
│   │           │                   │   ├── V2TRCFJsonResource.java
│   │           │                   │   └── V2TRCFToV3StateConverterTest.java
│   │           │                   └── threshold/
│   │           │                       └── BasicThresholderTest.java
│   │           └── resources/
│   │               └── com/
│   │                   └── amazon/
│   │                       └── randomcutforest/
│   │                           └── parkservices/
│   │                               └── state/
│   │                                   ├── byte_base64_1.txt
│   │                                   ├── byte_base64_2.txt
│   │                                   ├── state_1.json
│   │                                   └── state_2.json
│   ├── pom.xml
│   ├── serialization/
│   │   ├── pom.xml
│   │   └── src/
│   │       ├── main/
│   │       │   └── java/
│   │       │       └── com/
│   │       │           └── amazon/
│   │       │               └── randomcutforest/
│   │       │                   └── serialize/
│   │       │                       └── json/
│   │       │                           ├── v1/
│   │       │                           │   ├── V1JsonToV3StateConverter.java
│   │       │                           │   └── V1SerializedRandomCutForest.java
│   │       │                           └── v2/
│   │       │                               └── V2StateToV3ForestConverter.java
│   │       └── test/
│   │           ├── java/
│   │           │   └── com/
│   │           │       └── amazon/
│   │           │           └── randomcutforest/
│   │           │               └── serialize/
│   │           │                   └── json/
│   │           │                       └── v1/
│   │           │                           ├── V1JsonResource.java
│   │           │                           └── V1JsonToV3StateConverterTest.java
│   │           └── resources/
│   │               └── com/
│   │                   └── amazon/
│   │                       └── randomcutforest/
│   │                           └── serialize/
│   │                               └── json/
│   │                                   └── v1/
│   │                                       ├── forest_1.json
│   │                                       └── forest_2.json
│   ├── spotless-eclipse.xml
│   └── testutils/
│       ├── pom.xml
│       └── src/
│           └── main/
│               └── java/
│                   └── com/
│                       └── amazon/
│                           └── randomcutforest/
│                               └── testutils/
│                                   ├── ExampleDataSets.java
│                                   ├── MultiDimDataWithKey.java
│                                   ├── NormalMixtureTestData.java
│                                   ├── ShingledData.java
│                                   └── ShingledMultiDimDataWithKeys.java
├── LICENSE
├── NOTICE
├── README.md
├── Rust/
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── README.md
│   ├── rustfmt.toml
│   ├── src/
│   │   ├── common/
│   │   │   ├── cluster.rs
│   │   │   ├── conditionalfieldsummarizer.rs
│   │   │   ├── descriptor.rs
│   │   │   ├── deviation.rs
│   │   │   ├── directionaldensity.rs
│   │   │   ├── divector.rs
│   │   │   ├── intervalstoremanager.rs
│   │   │   ├── mod.rs
│   │   │   ├── multidimdatawithkey.rs
│   │   │   ├── rangevector.rs
│   │   │   └── samplesummary.rs
│   │   ├── errors.rs
│   │   ├── example.rs
│   │   ├── glad.rs
│   │   ├── lib.rs
│   │   ├── pointstore.rs
│   │   ├── rcf.rs
│   │   ├── samplerplustree/
│   │   │   ├── boundingbox.rs
│   │   │   ├── cut.rs
│   │   │   ├── mod.rs
│   │   │   ├── nodestore.rs
│   │   │   ├── nodeview.rs
│   │   │   ├── randomcuttree.rs
│   │   │   ├── sampler.rs
│   │   │   └── samplerplustree.rs
│   │   ├── trcf/
│   │   │   ├── basicthresholder.rs
│   │   │   ├── basictrcf.rs
│   │   │   ├── errorhandler.rs
│   │   │   ├── mod.rs
│   │   │   ├── multitrcf.rs
│   │   │   ├── predictorcorrector.rs
│   │   │   ├── preprocessor.rs
│   │   │   ├── rcfcaster.rs
│   │   │   ├── transformer.rs
│   │   │   └── types.rs
│   │   ├── types.rs
│   │   ├── util.rs
│   │   └── visitor/
│   │       ├── attributionvisitor.rs
│   │       ├── imputevisitor.rs
│   │       ├── interpolationvisitor.rs
│   │       ├── mod.rs
│   │       ├── scalarscorevisitor.rs
│   │       └── visitor.rs
│   └── tests/
│       ├── anomalydetectionattributionupdate.rs
│       ├── anomalydetectionimputescoreupdate.rs
│       ├── anomalydetectionscoreupdate.rs
│       ├── basicrcftest.rs
│       ├── basictrcftest.rs
│       ├── clustertest.rs
│       ├── dynamicdensitytest.rs
│       ├── gladtest.rs
│       ├── imputedifferentperiod.rs
│       ├── imputesameperiod.rs
│       ├── multitrcftest.rs
│       └── samplesummarytest.rs
├── THIRD-PARTY
├── example-data/
│   └── rcf-paper.csv
└── python_rcf_wrapper/
    ├── README.md
    ├── __init__.py
    ├── lib/
    │   ├── randomcutforest-core-4.0.0-SNAPSHOT.jar
    │   └── randomcutforest-parkservices-4.0.0-SNAPSHOT.jar
    ├── rcf_model.py
    └── trcf_model.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/draft-release-notes-config.yml
================================================
# The overall template of the release notes
template: |
  $CHANGES

# Setting the formatting and sorting for the release notes body
name-template: Version (set version here)
change-template: "* $TITLE ([#$NUMBER]($URL))"
sort-by: merged_at
sort-direction: ascending
replacers:
  - search: "##"
    replace: "###"

# Organizing the tagged PRs into unified categories
categories:
  - title: "Breaking changes"
    labels:
      - "breaking change"
  - title: "Features"
    labels:
      - "feature"
  - title: "Enhancements"
    labels:
      - "enhancement"
  - title: "Bug Fixes"
    labels:
      - "bug"
      - "bug fix"
  - title: "Infrastructure"
    labels:
      - "infra"
      - "test"
      - "dependencies"
      - "github actions"
  - title: "Documentation"
    labels:
      - "documentation"
  - title: "Maintenance"
    labels:
      - "version upgrade"
      - "odfe release"
  - title: "Refactoring"
    labels:
      - "refactor"
      - "code quality"


================================================
FILE: .github/workflows/draft-release-notes-workflow.yml
================================================
name: Release Drafter

on:
  push:
    branches:
      - main

jobs:
  update_release_draft:
    name: Update draft release notes
    runs-on: ubuntu-latest
    steps:
      - name: Update draft release notes
        uses: release-drafter/release-drafter@v5
        with:
          config-name: draft-release-notes-config.yml
          name: Version (set here)
          tag: (None)
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

================================================
FILE: .github/workflows/maven-release.yml
================================================
# This workflow will build a package using Maven and then publish it to
# to our staging repo for a final release to maven central

# This workflow will also create a tag and github release for the current commit
# The github release will be have '-java' added to name to distinguish rust vs java releases
# Example:
# current version in POM.XML and in maven central = 3.1.0
# tag and github release = 3.1.0-java
name: Publish Official Release to Maven Staging

defaults:
  run:
    working-directory: Java/

on:
  workflow_dispatch:


permissions:
  contents: write

jobs:
  build:
    name: Build project and publish release
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Set up JDK 17
      uses: actions/setup-java@v1
      with:
        java-version: 17
        cache: maven
        server-id: ossrh
        server-username: MAVEN_USERNAME
        server-password: MAVEN_PASSWORD
        gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
        gpg-passphrase: MAVEN_GPG_PASSPHRASE
    - name: Extract project version
      id: project
      run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
    - name: Build with Maven
      run: mvn -B package --file pom.xml
    - name: Publish to Maven central
      if: ${{ !endsWith(steps.project.outputs.version, '-SNAPSHOT') }}
      run: mvn -B deploy --file pom.xml -Pgpg-sign
      env:
        MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
        MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
        MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
    
    - name: Create Release
      id: create_release
      uses: actions/create-release@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        tag_name: ${{ steps.project.outputs.version }}-java
        release_name: ${{ steps.project.outputs.version }}-java
        draft: false
        prerelease: false


================================================
FILE: .github/workflows/maven-snapshot.yml
================================================
name: Build and publish snapshot on push to main
on:
  push:
    branches:
      - main


permissions:
  contents: read

defaults:
  run:
    working-directory: Java/

jobs:
  build:
    name: Build project and publish SNAPSHOT
    runs-on: ubuntu-latest  
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v1
      - name: Set up java for publishing snapshot
        uses: actions/setup-java@v1
        with:
          java-version: 17
          server-id: ossrh-snapshot
          server-username: MAVEN_USERNAME
          server-password: MAVEN_PASSWORD
          gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
          gpg-passphrase: MAVEN_GPG_PASSPHRASE
      - name: Build with Maven
        run: mvn -B package --file pom.xml
      - name: Extract project version
        id: project
        run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
      - name: Publish to snapshot repo
        if: ${{ endsWith(steps.project.outputs.version, '-SNAPSHOT') }}
        run: mvn -B deploy --file pom.xml -Pgpg-sign
        env:
          MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
          MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
          MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

================================================
FILE: .github/workflows/maven.yml
================================================
name: Java CI

on:
  pull_request:
    branches: 
      - '*'
    paths:
      - Java/**


permissions:
  contents: read

defaults:
  run:
    working-directory: Java/

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Set up JDK 17
      uses: actions/setup-java@v1
      with:
        java-version: 17
    - name: Build with Maven
      run: mvn -B package --file pom.xml


================================================
FILE: .github/workflows/rust.yml
================================================
name: Rust CI

on:
  pull_request:
    branches: [ main ]
    paths: [ Rust/** ]


permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always
  
defaults:
  run:
    working-directory: Rust/

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Build Rust
      run: cargo build --verbose
    - name: Run Rust Tests
      run: cargo test --verbose


================================================
FILE: .gitignore
================================================
build
target
.idea
*.iml
.project
.settings
.classpath
._.DS_Store
.DS_Store
Java/*/bin/



================================================
FILE: CODE_OF_CONDUCT.md
================================================
## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
opensource-codeofconduct@amazon.com with any additional questions or comments.


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing Guidelines

Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
documentation, we greatly value feedback and contributions from our community.

Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
information to effectively respond to your bug report or contribution.


## Reporting Bugs/Feature Requests

We welcome you to use the GitHub issue tracker to report bugs or suggest features.

When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:

* A reproducible test case or series of steps
* The version of our code being used
* Any modifications you've made relevant to the bug
* Anything unusual about your environment or deployment


## Contributing via Pull Requests
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

1. You are working against the latest source on the *master* branch.
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.

To send us a pull request, please:

1. Fork the repository.
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
3. Ensure local tests pass.
4. Commit to your fork using clear commit messages.
5. Send us a pull request, answering any default questions in the pull request interface.
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).


## Finding contributions to work on
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.


## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
opensource-codeofconduct@amazon.com with any additional questions or comments.


## Security issue notifications
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.


## Licensing

See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.

We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.


================================================
FILE: Java/README.md
================================================
# Random Cut Forest

This directory contains a Java implementation of the Random Cut Forest data structure and algorithms
for anomaly detection, density estimation, imputation, and forecast. The goal of this library 
is to be easy to use and to strike a balance between efficiency and extensibility. Please do not forget 
to look into the ParkServices package that provide many augmented functionalities such as explicit determination 
of anomaly grade based on the first hand understanding of the core algorithm. Please also see randomcutforest-examples 
for a few detailed examples and extensions. Please do not hesitate to creat an issue for any discussion item.

## Basic operations

To create a RandomCutForest instance with all parameters set to defaults:

```java
int dimensions = 5; // The number of dimensions in the input data, required
RandomCutForest forest = RandomCutForest.defaultForest(dimensions);
```
We recommend using shingle size which correspond to contextual analysis of data, 
and RCF uses ideas not dissimilar from higher order Markov Chains to improve its 
accuracy. An option is provided to have the shingles be constructed internally. 
To explicitly set optional parameters like number of trees in the forest or 
sample size, RandomCutForest provides a builder (for example with 4 input dimensions for 
a 4-way multivariate analysis):

```java
RandomCutForest forest = RandomCutForest.builder()
        .numberOfTrees(90)
        .sampleSize(200) // use this cover the phenomenon of interest
                         // for analysis of 5 minute aggregations, a week has
                         // about 12 * 24 * 7 starting points of interest
                         // larger sample sizes will be larger models 
        .dimensions(inputDimension*4) // still required!
        .timeDecay(0.2) // determines half life of data
        .randomSeed(123)
        .internalShingleEnabled(true)
        .shingleSize(7)
        .build();
```

Typical usage of a forest is to compute a statistic on an input data point and then update the forest with that point 
in a loop.

```java
Supplier<double[]> input = ...;

while (true) {
    double[] point = input.get();
    double score = forest.getAnomalyScore(point);
    forest.update(point);
    System.out.println("Anomaly Score: " + score);
}
```

## Limitations

* Update operations in a forest are *not thread-safe*. Running concurrent updates or running an update concurrently
  with a traversal may result in errors.


## Forest Configuration

The following parameters can be configured in the RandomCutForest builder. 

| Parameter Name              | Type    | Description                                                                                                                                                                                                                                                                                                                                                    | Default Value                                                                         |
|-----------------------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| dimensions                  | int     | The number of dimensions in the input data.                                                                                                                                                                                                                                                                                                                    | Required, no default value. Should be the product of input dimensions and shingleSize |
| shingleSize                 | int     | The number of contiguous observations across all the input variables that would be used for analysis                                                                                                                                                                                                                                                           | Strongly recommended for contextual anomalies. Required for Forecast/Extrapolate      |
| lambda                      | double  | The decay factor used by stream samplers in this forest. See the next section for guidance.                                                                                                                                                                                                                                                                    | 1 / (10 * sampleSize)                                                                 |
| numberOfTrees               | int     | The number of trees in this forest.                                                                                                                                                                                                                                                                                                                            | 50                                                                                    |
| outputAfter                 | int     | The number of points required by stream samplers before results are returned.                                                                                                                                                                                                                                                                                  | 0.25 * sampleSize                                                                     |
| internalShinglingEnabled    | boolean | Whether the shingling is performed by RCF itself since it has already seen previous values.                                                                                                                                                                                                                                                                    | false (for historical reasons). Recommended : true, will result in smaller models.    |
| parallelExecutionEnabled    | boolean | If true, then the forest will create an internal threadpool. Forest updates and traversals will be submitted to this threadpool, and individual trees will be updated or traversed in parallel. For larger shingle sizes, dimensions, and number of trees, parallelization may improve throughput. We recommend users benchmark against their target use case. | false                                                                                 |
| randomSeed                  | long    | A seed value used to initialize the random number generators in this forest.                                                                                                                                                                                                                                                                                   |                                                                                       |
| sampleSize                  | int     | The sample size used by stream samplers in this forest                                                                                                                                                                                                                                                                                                         | 256                                                                                   |
| centerOfMassEnabled         | boolean | If true, then tree nodes in the forest will compute their center of mass as part of tree update operations.                                                                                                                                                                                                                                                    | false                                                                                 |
| storeSequenceIndexesEnabled | boolean | If true, then sequence indexes (ordinals indicating when a point was added to a tree) will be stored in the forest along with poitn values.                                                                                                                                                                                                                    | false                                                                                 |
| threadPoolSize              | int     | The number of threads to use in the internal threadpool.                                                                                                                                                                                                                                                                                                       | Number of available processors - 1                                                    |

The above parameters are the most common and historical. Please use the issues to request additions/discussions of other parameters of interest.

RandomCutForest primarily provides an estimation (say anomaly score, or extrapolation over a forecast horizon) and using that raw estimation can be challenging. The ParkServices package provides 
several capabilities (ThresholdedRandomCutForest, RCFCaster, respectively) for distilling the scores to a determination of 
anomaly/otherwise (an assesment of grade) or calibrated conformal forecasts. These have natural parameter choices that are different 
from the core RandomCutForest -- for example internalShinglingEnabled defaults to true since that is more natural in those contexts.
The package examples provides a collection of examples and uses of parameters, we draw the attention to ThresholdedMultiDimensionalExample 
and RCFCasterExample. If one is interested in sequential analysis of a series of consecutive inputs, check out SequentialAnomalyExample. 
ParkServices also exposes many other functionalities of RCF which were covert, such as clustering (including multi-centroid representations) 
-- see NumericGLADExample for instance. 

## Choosing a `timeDecay` value for your application

When we submit a point to the sampler, it is included into the sample with some probability, and 
it will remain in the for some number of steps before being replaced. Call the number of steps that
a point is included in the sample the "lifetime" of the point (which may be 0). Over a finite time
window, the distribution of the lifetime of a point is approximately exponential with parameter
`lambda`. Thus, `1 / timmeDecay` is approximately the average number of steps that a point will be included
in the sample. By default, we set `timeDecay` equal to `1 / (10 * sampleSize)`.

Alternatively, if you want the probability that a point survives longer than n steps to be 0.05,
you can solve for `lambda` in the equation `exp(-lambda * n) = 0.05`.

We note again that this is heuristic and not mathematically rigorous. We refer the interested reader
to [Weighted Random Sampling (2005;  Efraimidis, Spirakis)](http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=BEB1FE0AB3C0129B822D2CE5EABBFD42?doi=10.1.1.591.4194&rep=rep1&type=pdf).

## Setup

1. Checkout this package from our GitHub repository.
1. Install [Apache Maven](https://maven.apache.org/) by following the directions on that site.
1. Set your `JAVA_HOME` environment variable to a JDK version 8 or greater.

## Build

Build the modules in this package and run the full test suite by running

```text
mvn package
```

For a faster build that excludes the long-running "functional" tests, run

```text
mvn package -DexcludedGroups=functional
```

## Build Command-line (CLI) usage

> **Important.** The CLI applications use `String::split` to read delimited data
> and as such are **not intended for production use**.

For some of the algorithms included in this package there are CLI applications
that can be used for experimentation as well as a way to learn about these
algorithms and their hyperparameters. After building the project you can invoke
an example CLI application by adding the core jar file to your classpath.

In the example below we train and score a Random Cut Forest model on the
three-dimensional data shown in Figure 3 in the original RCF paper.
([PDF][rcf-paper]) These example data can be
found at `../example-data/rcf-paper.csv`:

```text
$ tail data/example.csv
-5.0074,-0.0038,-0.0237
-5.0029,0.0170,-0.0057
-4.9975,-0.0102,-0.0065
4.9878,0.0136,-0.0087
5.0118,0.0098,-0.0057
0.0158,0.0061,0.0091
5.0167,0.0041,0.0054
-4.9947,0.0126,-0.0010
-5.0209,0.0004,-0.0033
4.9923,-0.0142,0.0030
```

(Note that there is one data point above that is not like the others.) The
`AnomalyScoreRunner` application reads in each line of the input data as a
vector data point, scores the data point, and then updates the model with this
point. The program output appends a column of anomaly scores to the input:

```text
$ java -cp core/target/randomcutforest-core-4.4.0.jar com.amazon.randomcutforest.runner.AnomalyScoreRunner < ../example-data/rcf-paper.csv > example_output.csv
$ tail example_output.csv
-5.0029,0.0170,-0.0057,0.8129401629464965
-4.9975,-0.0102,-0.0065,0.6591046054520615
4.9878,0.0136,-0.0087,0.8552217070518414
5.0118,0.0098,-0.0057,0.7224686064066762
0.0158,0.0061,0.0091,2.8299054033889814
5.0167,0.0041,0.0054,0.7571453322237215
-4.9947,0.0126,-0.0010,0.7259960347128676
-5.0209,0.0004,-0.0033,0.9119498264685114
4.9923,-0.0142,0.0030,0.7310102658466711
Done.
```

(As you can see the anomalous data point was given large anomaly score.) You can
read additional usage instructions, including options for setting model
hyperparameters, using the `--help` flag:

```text
$ java -cp core/target/randomcutforest-core-4.4.0.jar com.amazon.randomcutforest.runner.AnomalyScoreRunner --help
Usage: java -cp target/random-cut-forest-4.4.0.jar com.amazon.randomcutforest.runner.AnomalyScoreRunner [options] < input_file > output_file

Compute scalar anomaly scores from the input rows and append them to the output rows.

Options:
        --delimiter, -d: The character or string used as a field delimiter. (default: ,)
        --header-row: Set to 'true' if the data contains a header row. (default: false)
        --number-of-trees, -n: Number of trees to use in the forest. (default: 100)
        --random-seed: Random seed to use in the Random Cut Forest (default: 42)
        --sample-size, -s: Number of points to keep in sample for each tree. (default: 256)
        --shingle-cyclic, -c: Set to 'true' to use cyclic shingles instead of linear shingles. (default: false)
        --shingle-size, -g: Shingle size to use. (default: 1)
        --window-size, -w: Window size of the sample or 0 for no window. (default: 0)

        --help, -h: Print this help message and exit.
```

Other CLI applications are available in the `com.amazon.randomcutforest.runner`
package.

## Testing

The core library test suite is divided into unit tests and "functional" tests. By "functional", we mean tests that 
verify the expected behavior of the algorithms defined in the package. For example, a functional test for the anomaly 
detection algorithm will first train a forest on a pre-defined distribution and then verify that the forest assigns a 
high anomaly score to anomalous points (where "anomalous" is with respect to the specified distribution). Functional 
tests are indicated both in the test class name (e.g., `RandomCutForestFunctionalTest`) and in a `@Tag` annotation on 
the test class.

The full test suite including functional tests currently takes over 10 minutes to complete. If you are contributing to
this package, we recommend excluding the functional tests while actively developing, and only running the full test
suite before creating a pull request. Functional tests can be excluded from Maven build targets by passing
`-DexcludedGroups=functional` at the command line. For example:

```text
% mvn test -DexcludedGroups=functional
```

In the core library we have 90% line coverage with the full test suite, and 80% line coverage when running the unit 
tests only (i.e., when excluding functional tests). Our goal is to reach 100% unit test coverage, and we welcome (and 
encourage!) test contributions. After running tests with Maven, you can see the test coverage broken out by class by 
opening `target/site/jacoco/index.html` in a web browser.

Our tests are implemented in [JUnit 5](https://junit.org/junit5/) with [Mockito](https://site.mockito.org/), [Powermock](https://github.com/powermock/powermock), and [Hamcrest](http://hamcrest.org/) for testing. 
Test dependencies will be downloaded automatically when invoking `mvn test` or `mvn package`.

## Benchmarks

The benchmark modules defines microbenchmarks using the [JMH](https://openjdk.java.net/projects/code-tools/jmh/) 
framework. Build an executable jar containing the benchmark code by running

```text
% # (Optional) To benchmark the code in your local repository, build and install to your local Maven repository
% # Otherwise, benchmark dependencies will be pulled from Maven central
% mvn package install -DexcludedGroups=functional
% 
% mvn -pl benchmark package assembly:single
```

To invoke the full benchmark suite:

```text
% java -jar benchmark/target/randomcutforest-benchmark-4.4.0-jar-with-dependencies.jar
```

The full benchmark suite takes a long time to run. You can also pass a regex at the command-line, then only matching
benchmark methods will be executed.

```text
% java -jar benchmark/target/randomcutforest-benchmark-4.4.0-jar-with-dependencies.jar RandomCutForestBenchmark\.updateAndGetAnomalyScore
```

[rcf-paper]: http://proceedings.mlr.press/v48/guha16.pdf


================================================
FILE: Java/RELEASING.md
================================================
- [Overview](#overview)
- [Feature Branches](#feature-branches)
- [Release Labels](#release-labels)
- [Releasing](#releasing)

## Overview

This document explains the release strategy for the Random Cut Forest project.

## Feature Branches

Do not create branches in the upstream repo, use your fork, for the exception of long lasting feature branches that require active collaboration from multiple developers. Name feature branches `feature/<thing>`. Once the work is merged to `main`, please make sure to delete the feature branch.

## Release Labels

Repositories create consistent release labels, such as `3.0.0-java`. Use release labels to target an issue or a PR for a given release.

## Releasing

The release process is run by a release manager volunteering from amongst the maintainers.

1. Create a PR to bump version to desired release candidate (e.g. 3.0.0).
2. Click run on the maven-release workflow in Github Actions which uploads the artifacts to our staging repository, creates a new tag, and a new Github release.
3. Login into the nexus staging repository, verify artifact was signed successfully and click release to officially push to maven central.

================================================
FILE: Java/benchmark/pom.xml
================================================
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>software.amazon.randomcutforest</groupId>
    <artifactId>randomcutforest-parent</artifactId>
    <version>4.4.0</version>
  </parent>

  <artifactId>randomcutforest-benchmark</artifactId>
  <packaging>jar</packaging>

  <properties>
    <jmh.version>1.22</jmh.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>software.amazon.randomcutforest</groupId>
      <artifactId>randomcutforest-core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>software.amazon.randomcutforest</groupId>
      <artifactId>randomcutforest-testutils</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>software.amazon.randomcutforest</groupId>
      <artifactId>randomcutforest-serialization</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-core</artifactId>
      <version>${jmh.version}</version>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-generator-annprocess</artifactId>
      <version>${jmh.version}</version>
    </dependency>
    <dependency>
      <groupId>com.github.jbellis</groupId>
      <artifactId>jamm</artifactId>
      <version>0.3.3</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>2.16.0</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.16.0</version>
    </dependency>
    <dependency>
      <groupId>io.protostuff</groupId>
      <artifactId>protostuff-core</artifactId>
      <version>1.8.0</version>
    </dependency>
    <dependency>
      <groupId>io.protostuff</groupId>
      <artifactId>protostuff-runtime</artifactId>
      <version>1.8.0</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
          <archive>
            <manifest>
              <mainClass>org.openjdk.jmh.Main</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>


================================================
FILE: Java/benchmark/src/main/java/com/amazon/randomcutforest/RandomCutForestBenchmark.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import java.util.List;
import java.util.Random;

import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.OperationsPerInvocation;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;

import com.amazon.randomcutforest.returntypes.DensityOutput;
import com.amazon.randomcutforest.returntypes.DiVector;
import com.amazon.randomcutforest.returntypes.Neighbor;
import com.amazon.randomcutforest.testutils.NormalMixtureTestData;

@Warmup(iterations = 2)
@Measurement(iterations = 5)
@Fork(value = 1)
@State(Scope.Thread)
public class RandomCutForestBenchmark {

    public final static int DATA_SIZE = 50_000;
    public final static int INITIAL_DATA_SIZE = 25_000;

    @State(Scope.Benchmark)
    public static class BenchmarkState {
        @Param({ "40" })
        int baseDimensions;

        @Param({ "1" })
        int shingleSize;

        @Param({ "30" })
        int numberOfTrees;

        @Param({ "1.0", "0.9", "0.8", "0.7", "0.6", "0.5", "0.4", "0.3", "0.2", "0.1", "0.0" })
        double boundingBoxCacheFraction;

        @Param({ "false", "true" })
        boolean parallel;

        double[][] data;
        RandomCutForest forest;

        @Setup(Level.Trial)
        public void setUpData() {
            int dimensions = baseDimensions * shingleSize;
            NormalMixtureTestData gen = new NormalMixtureTestData();
            data = gen.generateTestData(INITIAL_DATA_SIZE + DATA_SIZE, dimensions);
        }

        @Setup(Level.Invocation)
        public void setUpForest() {
            forest = RandomCutForest.builder().numberOfTrees(numberOfTrees).dimensions(baseDimensions * shingleSize)
                    .internalShinglingEnabled(true).shingleSize(shingleSize).parallelExecutionEnabled(parallel)
                    .boundingBoxCacheFraction(boundingBoxCacheFraction).randomSeed(99).build();

            for (int i = 0; i < INITIAL_DATA_SIZE; i++) {
                forest.update(data[i]);
            }
        }
    }

    private RandomCutForest forest;

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest updateOnly(BenchmarkState state) {
        double[][] data = state.data;
        forest = state.forest;

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            forest.update(data[i]);
        }

        return forest;
    }

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest scoreOnly(BenchmarkState state, Blackhole blackhole) {
        double[][] data = state.data;
        forest = state.forest;
        double score = 0.0;
        Random rnd = new Random(0);

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            score += forest.getAnomalyScore(data[i]);
            if (rnd.nextDouble() < 0.01) {
                forest.update(data[i]); // this should execute sparingly
            }
        }

        blackhole.consume(score);
        return forest;
    }

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest scoreAndUpdate(BenchmarkState state, Blackhole blackhole) {
        double[][] data = state.data;
        forest = state.forest;
        double score = 0.0;

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            score = forest.getAnomalyScore(data[i]);
            forest.update(data[i]);
        }

        blackhole.consume(score);
        return forest;
    }

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest attributionAndUpdate(BenchmarkState state, Blackhole blackhole) {
        double[][] data = state.data;
        forest = state.forest;
        DiVector vector = new DiVector(forest.getDimensions());

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            vector = forest.getAnomalyAttribution(data[i]);
            forest.update(data[i]);
        }

        blackhole.consume(vector);
        return forest;
    }

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest basicDensityAndUpdate(BenchmarkState state, Blackhole blackhole) {
        double[][] data = state.data;
        forest = state.forest;
        DensityOutput output = new DensityOutput(forest.getDimensions(), forest.getSampleSize());

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            output = forest.getSimpleDensity(data[i]);
            forest.update(data[i]);
        }

        blackhole.consume(output);
        return forest;
    }

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest basicNeighborAndUpdate(BenchmarkState state, Blackhole blackhole) {
        double[][] data = state.data;
        forest = state.forest;
        List<Neighbor> output = null;

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            output = forest.getNearNeighborsInSample(data[i]);
            forest.update(data[i]);
        }

        blackhole.consume(output);
        return forest;
    }

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest imputeAndUpdate(BenchmarkState state, Blackhole blackhole) {
        double[][] data = state.data;
        forest = state.forest;
        double[] output = null;

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            output = forest.imputeMissingValues(data[i], 1, new int[] { forest.dimensions - 1 });
            forest.update(data[i]);
        }

        blackhole.consume(output);
        return forest;
    }
}


================================================
FILE: Java/benchmark/src/main/java/com/amazon/randomcutforest/RandomCutForestShingledBenchmark.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import java.util.List;
import java.util.Random;

import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.OperationsPerInvocation;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;

import com.amazon.randomcutforest.returntypes.DensityOutput;
import com.amazon.randomcutforest.returntypes.DiVector;
import com.amazon.randomcutforest.returntypes.Neighbor;
import com.amazon.randomcutforest.testutils.ShingledMultiDimDataWithKeys;

@Warmup(iterations = 2)
@Measurement(iterations = 5)
@Fork(value = 1)
@State(Scope.Thread)
public class RandomCutForestShingledBenchmark {

    public final static int DATA_SIZE = 50_000;
    public final static int INITIAL_DATA_SIZE = 25_000;

    @State(Scope.Benchmark)
    public static class BenchmarkState {
        @Param({ "5" })
        int baseDimensions;

        @Param({ "8" })
        int shingleSize;

        @Param({ "30" })
        int numberOfTrees;

        @Param({ "1.0", "0.9", "0.8", "0.7", "0.6", "0.5", "0.4", "0.3", "0.2", "0.1", "0.0" })
        double boundingBoxCacheFraction;

        @Param({ "false", "true" })
        boolean parallel;

        double[][] data;
        RandomCutForest forest;

        @Setup(Level.Trial)
        public void setUpData() {
            data = ShingledMultiDimDataWithKeys.getMultiDimData(DATA_SIZE + INITIAL_DATA_SIZE, 50, 100, 5, 17,
                    baseDimensions).data;
        }

        @Setup(Level.Invocation)
        public void setUpForest() {
            forest = RandomCutForest.builder().numberOfTrees(numberOfTrees).dimensions(baseDimensions * shingleSize)
                    .internalShinglingEnabled(true).shingleSize(shingleSize).parallelExecutionEnabled(parallel)
                    .boundingBoxCacheFraction(boundingBoxCacheFraction).randomSeed(99).build();

            for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
                forest.update(data[i]);
            }
        }
    }

    private RandomCutForest forest;

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest updateOnly(BenchmarkState state) {
        double[][] data = state.data;
        forest = state.forest;

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            forest.update(data[i]);
        }

        return forest;
    }

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest scoreOnly(BenchmarkState state, Blackhole blackhole) {
        double[][] data = state.data;
        forest = state.forest;
        double score = 0.0;
        Random rnd = new Random(0);

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            score += forest.getAnomalyScore(data[i]);
            if (rnd.nextDouble() < 0.01) {
                forest.update(data[i]); // this should execute sparingly
            }
        }

        blackhole.consume(score);
        return forest;
    }

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest scoreAndUpdate(BenchmarkState state, Blackhole blackhole) {
        double[][] data = state.data;
        forest = state.forest;
        double score = 0.0;

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            score = forest.getAnomalyScore(data[i]);
            forest.update(data[i]);
        }

        blackhole.consume(score);
        return forest;
    }

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest attributionAndUpdate(BenchmarkState state, Blackhole blackhole) {
        double[][] data = state.data;
        forest = state.forest;
        DiVector vector = new DiVector(forest.getDimensions());

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            vector = forest.getAnomalyAttribution(data[i]);
            forest.update(data[i]);
        }

        blackhole.consume(vector);
        return forest;
    }

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest basicDensityAndUpdate(BenchmarkState state, Blackhole blackhole) {
        double[][] data = state.data;
        forest = state.forest;
        DensityOutput output = new DensityOutput(forest.getDimensions(), forest.getSampleSize());

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            output = forest.getSimpleDensity(data[i]);
            forest.update(data[i]);
        }

        blackhole.consume(output);
        return forest;
    }

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest neighborAndUpdate(BenchmarkState state, Blackhole blackhole) {
        double[][] data = state.data;
        forest = state.forest;
        List<Neighbor> output = null;

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            output = forest.getNearNeighborsInSample(data[i]);
            forest.update(data[i]);
        }

        blackhole.consume(output);
        return forest;
    }

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest imputeAndUpdate(BenchmarkState state, Blackhole blackhole) {
        double[][] data = state.data;
        forest = state.forest;
        double[] output = null;

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            output = forest.imputeMissingValues(data[i], 1, new int[] { state.baseDimensions - 1 });
            forest.update(data[i]);
        }

        blackhole.consume(output);
        return forest;
    }

    @Benchmark
    @OperationsPerInvocation(DATA_SIZE)
    public RandomCutForest extrapolateAndUpdate(BenchmarkState state, Blackhole blackhole) {
        double[][] data = state.data;
        forest = state.forest;
        double[] output = null;

        for (int i = INITIAL_DATA_SIZE; i < data.length; i++) {
            output = forest.extrapolate(1);
            forest.update(data[i]);
        }

        blackhole.consume(output);
        return forest;
    }
}


================================================
FILE: Java/benchmark/src/main/java/com/amazon/randomcutforest/StateMapperBenchmark.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.OperationsPerInvocation;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.TearDown;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;

import com.amazon.randomcutforest.config.Precision;
import com.amazon.randomcutforest.profilers.ObjectGraphSizeProfiler;
import com.amazon.randomcutforest.profilers.OutputSizeProfiler;
import com.amazon.randomcutforest.state.RandomCutForestMapper;
import com.amazon.randomcutforest.state.RandomCutForestState;
import com.amazon.randomcutforest.testutils.NormalMixtureTestData;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import io.protostuff.LinkedBuffer;
import io.protostuff.ProtostuffIOUtil;
import io.protostuff.Schema;
import io.protostuff.runtime.RuntimeSchema;

@Warmup(iterations = 2)
@Measurement(iterations = 5)
@Fork(value = 1)
@State(Scope.Benchmark)
public class StateMapperBenchmark {
    public static final int NUM_TRAIN_SAMPLES = 2048;
    public static final int NUM_TEST_SAMPLES = 50;

    @State(Scope.Thread)
    public static class BenchmarkState {
        @Param({ "10" })
        int dimensions;

        @Param({ "50" })
        int numberOfTrees;

        @Param({ "256" })
        int sampleSize;

        @Param({ "false", "true" })
        boolean saveTreeState;

        @Param({ "FLOAT_32", "FLOAT_64" })
        Precision precision;

        double[][] trainingData;
        double[][] testData;
        RandomCutForestState forestState;
        String json;
        byte[] protostuff;

        @Setup(Level.Trial)
        public void setUpData() {
            NormalMixtureTestData gen = new NormalMixtureTestData();
            trainingData = gen.generateTestData(NUM_TRAIN_SAMPLES, dimensions);
            testData = gen.generateTestData(NUM_TEST_SAMPLES, dimensions);
        }

        @Setup(Level.Invocation)
        public void setUpForest() throws JsonProcessingException {
            RandomCutForest forest = RandomCutForest.builder().compact(true).dimensions(dimensions)
                    .numberOfTrees(numberOfTrees).sampleSize(sampleSize).precision(precision)
                    .boundingBoxCacheFraction(0.0).build();

            for (int i = 0; i < NUM_TRAIN_SAMPLES; i++) {
                forest.update(trainingData[i]);
            }

            RandomCutForestMapper mapper = new RandomCutForestMapper();
            mapper.setSaveExecutorContextEnabled(true);
            mapper.setSaveTreeStateEnabled(saveTreeState);
            forestState = mapper.toState(forest);

            ObjectMapper jsonMapper = new ObjectMapper();
            json = jsonMapper.writeValueAsString(forestState);

            Schema<RandomCutForestState> schema = RuntimeSchema.getSchema(RandomCutForestState.class);
            LinkedBuffer buffer = LinkedBuffer.allocate(512);
            try {
                protostuff = ProtostuffIOUtil.toByteArray(forestState, schema, buffer);
            } finally {
                buffer.clear();
            }
        }
    }

    private RandomCutForest forest;
    private byte[] bytes;

    @TearDown(Level.Iteration)
    public void tearDown() {
        OutputSizeProfiler.setTestArray(bytes);
        ObjectGraphSizeProfiler.setObject(forest);
    }

    @Benchmark
    @OperationsPerInvocation(NUM_TEST_SAMPLES)
    public RandomCutForestState roundTripFromState(BenchmarkState state, Blackhole blackhole) {
        RandomCutForestState forestState = state.forestState;
        double[][] testData = state.testData;

        for (int i = 0; i < NUM_TEST_SAMPLES; i++) {
            RandomCutForestMapper mapper = new RandomCutForestMapper();
            mapper.setSaveExecutorContextEnabled(true);
            mapper.setSaveTreeStateEnabled(state.saveTreeState);
            forest = mapper.toModel(forestState);
            double score = forest.getAnomalyScore(testData[i]);
            blackhole.consume(score);
            forest.update(testData[i]);
            forestState = mapper.toState(forest);
        }

        return forestState;
    }

    @Benchmark
    @OperationsPerInvocation(NUM_TEST_SAMPLES)
    public String roundTripFromJson(BenchmarkState state, Blackhole blackhole) throws JsonProcessingException {
        String json = state.json;
        double[][] testData = state.testData;

        for (int i = 0; i < NUM_TEST_SAMPLES; i++) {
            ObjectMapper jsonMapper = new ObjectMapper();
            RandomCutForestState forestState = jsonMapper.readValue(json, RandomCutForestState.class);

            RandomCutForestMapper mapper = new RandomCutForestMapper();
            mapper.setSaveExecutorContextEnabled(true);
            mapper.setSaveTreeStateEnabled(state.saveTreeState);
            forest = mapper.toModel(forestState);

            double score = forest.getAnomalyScore(testData[i]);
            blackhole.consume(score);
            forest.update(testData[i]);
            json = jsonMapper.writeValueAsString(mapper.toState(forest));
        }

        bytes = json.getBytes();
        return json;
    }

    @Benchmark
    @OperationsPerInvocation(NUM_TEST_SAMPLES)
    public byte[] roundTripFromProtostuff(BenchmarkState state, Blackhole blackhole) {
        bytes = state.protostuff;
        double[][] testData = state.testData;

        for (int i = 0; i < NUM_TEST_SAMPLES; i++) {
            Schema<RandomCutForestState> schema = RuntimeSchema.getSchema(RandomCutForestState.class);
            RandomCutForestState forestState = schema.newMessage();
            ProtostuffIOUtil.mergeFrom(bytes, forestState, schema);

            RandomCutForestMapper mapper = new RandomCutForestMapper();
            mapper.setSaveExecutorContextEnabled(true);
            mapper.setSaveTreeStateEnabled(state.saveTreeState);
            forest = mapper.toModel(forestState);

            double score = forest.getAnomalyScore(testData[i]);
            blackhole.consume(score);
            forest.update(testData[i]);
            forestState = mapper.toState(forest);

            LinkedBuffer buffer = LinkedBuffer.allocate(512);
            try {
                bytes = ProtostuffIOUtil.toByteArray(forestState, schema, buffer);
            } finally {
                buffer.clear();
            }
        }

        return bytes;
    }
}


================================================
FILE: Java/benchmark/src/main/java/com/amazon/randomcutforest/StateMapperShingledBenchmark.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import static java.lang.Math.PI;
import static java.lang.Math.cos;

import java.util.Random;

import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.OperationsPerInvocation;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.TearDown;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;

import com.amazon.randomcutforest.config.Precision;
import com.amazon.randomcutforest.profilers.OutputSizeProfiler;
import com.amazon.randomcutforest.state.RandomCutForestMapper;
import com.amazon.randomcutforest.state.RandomCutForestState;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import io.protostuff.LinkedBuffer;
import io.protostuff.ProtostuffIOUtil;
import io.protostuff.Schema;
import io.protostuff.runtime.RuntimeSchema;

@Warmup(iterations = 2)
@Measurement(iterations = 5)
@Fork(value = 1)
@State(Scope.Benchmark)
public class StateMapperShingledBenchmark {
    public static final int NUM_TRAIN_SAMPLES = 2048;
    public static final int NUM_TEST_SAMPLES = 50;

    @State(Scope.Thread)
    public static class BenchmarkState {
        @Param({ "10" })
        int dimensions;

        @Param({ "50" })
        int numberOfTrees;

        @Param({ "256" })
        int sampleSize;

        @Param({ "false", "true" })
        boolean saveTreeState;

        @Param({ "FLOAT_32", "FLOAT_64" })
        Precision precision;

        double[][] trainingData;
        double[][] testData;
        RandomCutForestState forestState;
        String json;
        byte[] protostuff;

        @Setup(Level.Trial)
        public void setUpData() {
            trainingData = genShingledData(NUM_TRAIN_SAMPLES, dimensions, 0);
            testData = genShingledData(NUM_TEST_SAMPLES, dimensions, 1);
        }

        @Setup(Level.Invocation)
        public void setUpForest() throws JsonProcessingException {
            RandomCutForest forest = RandomCutForest.builder().compact(true).dimensions(dimensions)
                    .numberOfTrees(numberOfTrees).sampleSize(sampleSize).precision(precision).shingleSize(dimensions)
                    .build();

            for (int i = 0; i < NUM_TRAIN_SAMPLES; i++) {
                forest.update(trainingData[i]);
            }

            RandomCutForestMapper mapper = new RandomCutForestMapper();
            mapper.setSaveExecutorContextEnabled(true);
            mapper.setSaveTreeStateEnabled(saveTreeState);
            forestState = mapper.toState(forest);

            ObjectMapper jsonMapper = new ObjectMapper();
            json = jsonMapper.writeValueAsString(forestState);

            Schema<RandomCutForestState> schema = RuntimeSchema.getSchema(RandomCutForestState.class);
            LinkedBuffer buffer = LinkedBuffer.allocate(512);
            try {
                protostuff = ProtostuffIOUtil.toByteArray(forestState, schema, buffer);
            } finally {
                buffer.clear();
            }
        }
    }

    private byte[] bytes;

    @TearDown(Level.Iteration)
    public void tearDown() {
        OutputSizeProfiler.setTestArray(bytes);
    }

    @Benchmark
    @OperationsPerInvocation(NUM_TEST_SAMPLES)
    public RandomCutForestState roundTripFromState(BenchmarkState state, Blackhole blackhole) {
        RandomCutForestState forestState = state.forestState;
        double[][] testData = state.testData;

        for (int i = 0; i < NUM_TEST_SAMPLES; i++) {
            RandomCutForestMapper mapper = new RandomCutForestMapper();
            mapper.setSaveExecutorContextEnabled(true);
            mapper.setSaveTreeStateEnabled(state.saveTreeState);
            RandomCutForest forest = mapper.toModel(forestState);
            double score = forest.getAnomalyScore(testData[i]);
            blackhole.consume(score);
            forest.update(testData[i]);
            forestState = mapper.toState(forest);
        }

        return forestState;
    }

    @Benchmark
    @OperationsPerInvocation(NUM_TEST_SAMPLES)
    public String roundTripFromJson(BenchmarkState state, Blackhole blackhole) throws JsonProcessingException {
        String json = state.json;
        double[][] testData = state.testData;

        for (int i = 0; i < NUM_TEST_SAMPLES; i++) {
            ObjectMapper jsonMapper = new ObjectMapper();
            RandomCutForestState forestState = jsonMapper.readValue(json, RandomCutForestState.class);

            RandomCutForestMapper mapper = new RandomCutForestMapper();
            mapper.setSaveExecutorContextEnabled(true);
            mapper.setSaveTreeStateEnabled(state.saveTreeState);
            RandomCutForest forest = mapper.toModel(forestState);

            double score = forest.getAnomalyScore(testData[i]);
            blackhole.consume(score);
            forest.update(testData[i]);
            json = jsonMapper.writeValueAsString(mapper.toState(forest));
        }

        bytes = json.getBytes();
        return json;
    }

    @Benchmark
    @OperationsPerInvocation(NUM_TEST_SAMPLES)
    public byte[] roundTripFromProtostuff(BenchmarkState state, Blackhole blackhole) {
        bytes = state.protostuff;
        double[][] testData = state.testData;

        for (int i = 0; i < NUM_TEST_SAMPLES; i++) {
            Schema<RandomCutForestState> schema = RuntimeSchema.getSchema(RandomCutForestState.class);
            RandomCutForestState forestState = schema.newMessage();
            ProtostuffIOUtil.mergeFrom(bytes, forestState, schema);

            RandomCutForestMapper mapper = new RandomCutForestMapper();
            mapper.setSaveExecutorContextEnabled(true);
            mapper.setSaveTreeStateEnabled(state.saveTreeState);
            RandomCutForest forest = mapper.toModel(forestState);

            double score = forest.getAnomalyScore(testData[i]);
            blackhole.consume(score);
            forest.update(testData[i]);
            forestState = mapper.toState(forest);

            LinkedBuffer buffer = LinkedBuffer.allocate(512);
            try {
                bytes = ProtostuffIOUtil.toByteArray(forestState, schema, buffer);
            } finally {
                buffer.clear();
            }
        }

        return bytes;
    }

    private static double[][] genShingledData(int size, int dimensions, long seed) {
        double[][] answer = new double[size][];
        int entryIndex = 0;
        boolean filledShingleAtleastOnce = false;
        double[] history = new double[dimensions];
        int count = 0;
        double[] data = getDataD(size + dimensions - 1, 100, 5, seed);
        for (int j = 0; j < size + dimensions - 1; ++j) { // we stream here ....
            history[entryIndex] = data[j];
            entryIndex = (entryIndex + 1) % dimensions;
            if (entryIndex == 0) {
                filledShingleAtleastOnce = true;
            }
            if (filledShingleAtleastOnce) {
                // System.out.println("Adding " + j);
                answer[count++] = getShinglePoint(history, entryIndex, dimensions);
            }
        }
        return answer;
    }

    private static double[] getShinglePoint(double[] recentPointsSeen, int indexOfOldestPoint, int shingleLength) {
        double[] shingledPoint = new double[shingleLength];
        int i = 0;
        for (int j = 0; j < shingleLength; ++j) {
            double point = recentPointsSeen[(j + indexOfOldestPoint) % shingleLength];
            shingledPoint[i++] = point;

        }
        return shingledPoint;
    }

    private static double[] getDataD(int num, double amplitude, double noise, long seed) {

        double[] data = new double[num];
        Random noiseprg = new Random(seed);
        for (int i = 0; i < num; i++) {
            data[i] = amplitude * cos(2 * PI * (i + 50) / 1000) + noise * noiseprg.nextDouble();
        }

        return data;
    }
}


================================================
FILE: Java/benchmark/src/main/java/com/amazon/randomcutforest/profilers/ObjectGraphSizeProfiler.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest.profilers;

import java.util.Collection;
import java.util.Collections;

import org.github.jamm.MemoryMeter;
import org.openjdk.jmh.infra.BenchmarkParams;
import org.openjdk.jmh.infra.IterationParams;
import org.openjdk.jmh.profile.InternalProfiler;
import org.openjdk.jmh.results.AggregationPolicy;
import org.openjdk.jmh.results.IterationResult;
import org.openjdk.jmh.results.Result;
import org.openjdk.jmh.results.ScalarResult;

/**
 * A profiler that uses the JAMM memory meter to measure the size of an object
 * graph.
 */
public class ObjectGraphSizeProfiler implements InternalProfiler {

    private static Object object;
    private static MemoryMeter meter = new MemoryMeter();

    public static void setObject(Object object) {
        ObjectGraphSizeProfiler.object = object;
    }

    @Override
    public void beforeIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
    }

    @Override
    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams,
            IterationResult iterationResult) {
        long size = 0;
        if (object != null) {
            size = meter.measureDeep(object);
            object = null;
        }
        ScalarResult result = new ScalarResult("+object-graph-size.bytes", size, "bytes", AggregationPolicy.AVG);
        return Collections.singleton(result);
    }

    @Override
    public String getDescription() {
        return null;
    }
}


================================================
FILE: Java/benchmark/src/main/java/com/amazon/randomcutforest/profilers/OutputSizeProfiler.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest.profilers;

import java.util.Collection;
import java.util.Collections;

import org.openjdk.jmh.infra.BenchmarkParams;
import org.openjdk.jmh.infra.IterationParams;
import org.openjdk.jmh.profile.InternalProfiler;
import org.openjdk.jmh.results.AggregationPolicy;
import org.openjdk.jmh.results.IterationResult;
import org.openjdk.jmh.results.Result;
import org.openjdk.jmh.results.ScalarResult;

/**
 * This simple profile outputs the size of a provided byte array or string as
 * part of the JMH metrics. We use it to measure the size of output in
 * {@link com.amazon.randomcutforest.StateMapperBenchmark}.
 */
public class OutputSizeProfiler implements InternalProfiler {

    private static byte[] bytes;

    public static void setTestString(String s) {
        bytes = s.getBytes();
    }

    public static void setTestArray(byte[] bytes) {
        OutputSizeProfiler.bytes = bytes;
    }

    @Override
    public void beforeIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams) {
    }

    @Override
    public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams,
            IterationResult iterationResult) {
        int length = 0;
        if (bytes != null) {
            length = bytes.length;
            bytes = null;
        }
        ScalarResult result = new ScalarResult("+output-size.bytes", length, "bytes", AggregationPolicy.AVG);
        return Collections.singleton(result);
    }

    @Override
    public String getDescription() {
        return null;
    }
}


================================================
FILE: Java/core/pom.xml
================================================
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>software.amazon.randomcutforest</groupId>
    <artifactId>randomcutforest-parent</artifactId>
    <version>4.4.0</version>
  </parent>

  <artifactId>randomcutforest-core</artifactId>
  <packaging>jar</packaging>

  <dependencies>
    <dependency>
      <groupId>software.amazon.randomcutforest</groupId>
      <artifactId>randomcutforest-testutils</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.30</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-easymock</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>2.16.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.16.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>


================================================
FILE: Java/core/src/main/java/com/amazon/randomcutforest/CommonUtils.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import java.util.Objects;
import java.util.function.Supplier;

import com.amazon.randomcutforest.tree.IBoundingBoxView;

/**
 * A collection of common utility functions.
 */
public class CommonUtils {

    private CommonUtils() {
    }

    /**
     * Throws an {@link IllegalArgumentException} with the specified message if the
     * specified input is false.
     *
     * @param condition A condition to test.
     * @param message   The error message to include in the
     *                  {@code IllegalArgumentException} if {@code condition} is
     *                  false.
     * @throws IllegalArgumentException if {@code condition} is false.
     */
    public static void checkArgument(boolean condition, String message) {

        if (!condition) {
            throw new IllegalArgumentException(message);
        }
    }

    // a lazy equivalent of the above, which avoids parameter evaluation
    public static void checkArgument(boolean condition, Supplier<String> messageSupplier) {
        if (!condition) {
            throw new IllegalArgumentException(messageSupplier.get());
        }
    }

    /**
     * Throws an {@link IllegalStateException} with the specified message if the
     * specified input is false.
     *
     * @param condition A condition to test.
     * @param message   The error message to include in the
     *                  {@code IllegalStateException} if {@code condition} is false.
     * @throws IllegalStateException if {@code condition} is false.
     */
    public static void checkState(boolean condition, String message) {
        if (!condition) {
            throw new IllegalStateException(message);
        }
    }

    /**
     * Throws an {@link IllegalStateException} with the specified message if the
     * specified input is false. This would eventually become asserts.
     *
     * @param condition A condition to test.
     * @param message   The error message to include in the
     *                  {@code IllegalStateException} if {@code condition} is false.
     * @throws IllegalStateException if {@code condition} is false.
     */
    public static void validateInternalState(boolean condition, String message) {
        if (!condition) {
            throw new IllegalStateException(message);
        }
    }

    /**
     * Throws a {@link NullPointerException} with the specified message if the
     * specified input is null.
     *
     * @param <T>     An arbitrary type.
     * @param object  An object reference to test for nullity.
     * @param message The error message to include in the
     *                {@code NullPointerException} if {@code object} is null.
     * @return {@code object} if not null.
     * @throws NullPointerException if the supplied object is null.
     */
    public static <T> T checkNotNull(T object, String message) {
        Objects.requireNonNull(object, message);
        return object;
    }

    /**
     * Compute the probability of separation for a bounding box adn a point. This
     * method considers the bounding box created by merging the query point into the
     * existing bounding box, and computes the probability that a random cut would
     * separate the query point from the merged bounding box.
     *
     * @param boundingBox is the bounding box used in RandomCutTree
     * @param queryPoint  is the multidimensional point
     * @return the probability of separation choosing a random cut
     */

    public static double getProbabilityOfSeparation(final IBoundingBoxView boundingBox, float[] queryPoint) {
        double sumOfNewRange = 0d;
        double sumOfDifferenceInRange = 0d;

        for (int i = 0; i < queryPoint.length; ++i) {
            double maxVal = boundingBox.getMaxValue(i);
            double minVal = boundingBox.getMinValue(i);
            double oldRange = maxVal - minVal;

            if (maxVal < queryPoint[i]) {
                maxVal = queryPoint[i];
            } else if (minVal > queryPoint[i]) {
                minVal = queryPoint[i];
            } else {
                sumOfNewRange += oldRange;
                continue;
            }

            double newRange = maxVal - minVal;
            sumOfNewRange += newRange;
            sumOfDifferenceInRange += (newRange - oldRange);
        }

        if (sumOfNewRange <= 0) {
            return 0;
        } else
            return sumOfDifferenceInRange / sumOfNewRange;
    }

    /**
     * The default anomaly scoring function for points that contained in a tree.
     *
     * @param depth The depth of the leaf node where this method is invoked
     * @param mass  The number of times the point has been seen before
     * @return The score contribution from this previously-seen point
     */
    public static double defaultScoreSeenFunction(double depth, double mass) {
        return 1.0 / (depth + Math.log(mass + 1.0) / Math.log(2.0));
    }

    /**
     * The default anomaly scoring function for points not already contained in a
     * tree.
     *
     * @param depth The depth of the leaf node where this method is invoked
     * @param mass  The number of times the point has been seen before
     * @return The score contribution from this point
     */
    public static double defaultScoreUnseenFunction(double depth, double mass) {
        return 1.0 / (depth + 1);
    }

    public static double defaultDampFunction(double leafMass, double treeMass) {
        return 1.0 - leafMass / (2 * treeMass);
    }

    /**
     * Some algorithms which return a scalar value need to scale that value by tree
     * mass for consistency. This is the default method for computing the scale
     * factor in these cases. The function has to be associative in its first
     * argument (when the second is fixed) That is, fn (x1, y) + fn (x2, y) = fn (x1
     * + x2, y)
     * 
     * @param scalarValue The value being scaled
     * @param mass        The mass of the tree where this method is invoked
     * @return The original value scaled appropriately for this tree
     */
    public static double defaultScalarNormalizerFunction(double scalarValue, double mass) {
        return scalarValue * Math.log(mass + 1) / Math.log(2.0);
    }

    /**
     * The following function forms the core of RCFs, given a BoundingBox it
     * produces the probability of cutting in different dimensions. While this
     * function is absorbed in the logic of the different simpler scoring methods,
     * the scoring methods that are mode advanced (for example, trying to simulate
     * an Transductive Isolation Forest with streaming) require this function. A
     * different function can be used to simulate via non-RCFs.
     * 
     * @param boundingBox bounding box of a set of points
     * @return array of probabilities of cutting in that specific dimension
     */

    public static double[] defaultRCFgVecFunction(IBoundingBoxView boundingBox) {
        double[] answer = new double[boundingBox.getDimensions()];

        for (int i = 0; i < boundingBox.getDimensions(); ++i) {
            double maxVal = boundingBox.getMaxValue(i);
            double minVal = boundingBox.getMinValue(i);
            double oldRange = maxVal - minVal;

            if (oldRange > 0) {
                answer[i] = oldRange;
            }
        }
        return answer;

    };

    public static double[] toDoubleArray(float[] array) {
        checkNotNull(array, "array must not be null");
        double[] result = new double[array.length];
        for (int i = 0; i < array.length; i++) {
            result[i] = array[i];
        }
        return result;
    }

    public static double[] toDoubleArrayNullable(float[] array) {
        return (array == null) ? null : toDoubleArray(array);
    }

    public static float[] toFloatArray(double[] array) {
        checkNotNull(array, "array must not be null");
        float[] result = new float[array.length];
        for (int i = 0; i < array.length; i++) {
            result[i] = (array[i] == 0) ? 0 : (float) array[i];
            // eliminating -0.0 issues
        }
        return result;
    }

    public static float[] toFloatArrayNullable(double[] array) {
        return (array == null) ? null : toFloatArray(array);
    }

    public static int[] toIntArray(byte[] values) {
        checkNotNull(values, "array must not be null");
        int[] result = new int[values.length];
        for (int i = 0; i < values.length; i++) {
            result[i] = values[i] & 0xff;
        }
        return result;
    }

    public static int[] toIntArray(char[] values) {
        checkNotNull(values, "array must not be null");
        int[] result = new int[values.length];
        for (int i = 0; i < values.length; i++) {
            result[i] = values[i];
        }
        return result;
    }

    public static char[] toCharArray(int[] values) {
        checkNotNull(values, "array must not be null");
        char[] result = new char[values.length];
        for (int i = 0; i < values.length; i++) {
            result[i] = (char) values[i];
        }
        return result;
    }

    public static byte[] toByteArray(int[] values) {
        checkNotNull(values, "array must not be null");
        byte[] result = new byte[values.length];
        for (int i = 0; i < values.length; i++) {
            result[i] = (byte) values[i];
        }
        return result;
    }
}


================================================
FILE: Java/core/src/main/java/com/amazon/randomcutforest/ComponentList.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import java.util.ArrayList;
import java.util.Collection;

/**
 * A ComponentList is an ArrayList specialized to contain IComponentModel
 * instances. Executor classes operate on ComponentLists.
 *
 * @param <PointReference> The internal point representation expected by the
 *                         component models in this list.
 * @param <Point>          The explicit data type of points being passed
 */
public class ComponentList<PointReference, Point> extends ArrayList<IComponentModel<PointReference, Point>> {
    public ComponentList() {
        super();
    }

    public ComponentList(Collection<? extends IComponentModel<PointReference, Point>> collection) {
        super(collection);
    }

    public ComponentList(int initialCapacity) {
        super(initialCapacity);
    }

}


================================================
FILE: Java/core/src/main/java/com/amazon/randomcutforest/IComponentModel.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import com.amazon.randomcutforest.config.IDynamicConfig;
import com.amazon.randomcutforest.executor.ITraversable;
import com.amazon.randomcutforest.executor.IUpdatable;

/**
 *
 * @param <PointReference> The internal point representation expected by the
 *                         component models in this list.
 * @param <Point>          The explicit data type of points being passed
 */

public interface IComponentModel<PointReference, Point>
        extends ITraversable, IUpdatable<PointReference>, IDynamicConfig {
}


================================================
FILE: Java/core/src/main/java/com/amazon/randomcutforest/IMultiVisitorFactory.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import com.amazon.randomcutforest.tree.ITree;

@FunctionalInterface
public interface IMultiVisitorFactory<R> {
    MultiVisitor<R> newVisitor(ITree<?, ?> tree, float[] point);

    default R liftResult(ITree<?, ?> tree, R result) {
        return result;
    }
}


================================================
FILE: Java/core/src/main/java/com/amazon/randomcutforest/IVisitorFactory.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import com.amazon.randomcutforest.tree.ITree;

@FunctionalInterface
public interface IVisitorFactory<R> {
    Visitor<R> newVisitor(ITree<?, ?> tree, float[] point);

    default R liftResult(ITree<?, ?> tree, R result) {
        return result;
    }
}


================================================
FILE: Java/core/src/main/java/com/amazon/randomcutforest/MultiVisitor.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import com.amazon.randomcutforest.tree.INodeView;

/**
 * This is the interface for a visitor which can be used with
 * {RandomCutTree::traversePathToLeafAndVisitNodesMulti}. In this traversal
 * method, we optionally choose to split the visitor into two copies when
 * visiting nodes. Each copy then visits one of the paths down from that node.
 * The results from both visitors are combined before returning back up the
 * tree.
 */
public interface MultiVisitor<R> extends Visitor<R> {

    /**
     * Returns true of the traversal method should split the visitor (i.e., create a
     * copy) at this node.
     *
     * @param node A node in the tree traversal
     * @return true if the traversal should split the visitor into two copies at
     *         this node, false otherwise.
     */
    boolean trigger(final INodeView node);

    /**
     * Return a partial copy of this visitor. The original visitor plus the copy
     * will each traverse one branch of the tree. The fields not copied will be
     * filled in by the branches of the tree
     *
     * @return a copy of this visitor
     */
    MultiVisitor<R> newPartialCopy();

    /**
     * Combine two visitors. The state of the argument visitor should be combined
     * with the state of this instance. This method is called after both visitors
     * have traversed one branch of the tree.
     *
     * @param other A second visitor
     */
    void combine(MultiVisitor<R> other);
}


================================================
FILE: Java/core/src/main/java/com/amazon/randomcutforest/MultiVisitorFactory.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import java.util.function.BiFunction;

import com.amazon.randomcutforest.tree.ITree;

/**
 * This is the interface for a visitor which can be used with
 * {RandomCutTree::traversePathToLeafAndVisitNodesMulti}. In this traversal
 * method, we optionally choose to split the visitor into two copies when
 * visiting nodes. Each copy then visits one of the paths down from that node.
 * The results from both visitors are combined before returning back up the
 * tree.
 */

public class MultiVisitorFactory<R> implements IMultiVisitorFactory<R> {
    private final BiFunction<ITree<?, ?>, float[], MultiVisitor<R>> newVisitor;
    private final BiFunction<ITree<?, ?>, R, R> liftResult;

    public MultiVisitorFactory(BiFunction<ITree<?, ?>, float[], MultiVisitor<R>> newVisitor,
            BiFunction<ITree<?, ?>, R, R> liftResult) {
        this.newVisitor = newVisitor;
        this.liftResult = liftResult;
    }

    public MultiVisitorFactory(BiFunction<ITree<?, ?>, float[], MultiVisitor<R>> newVisitor) {
        this(newVisitor, (tree, x) -> x);
    }

    @Override
    public MultiVisitor<R> newVisitor(ITree<?, ?> tree, float[] point) {
        return newVisitor.apply(tree, point);
    }

    @Override
    public R liftResult(ITree<?, ?> tree, R result) {
        return liftResult.apply(tree, result);
    }
}


================================================
FILE: Java/core/src/main/java/com/amazon/randomcutforest/PredictiveRandomCutForest.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import static com.amazon.randomcutforest.CommonUtils.checkArgument;
import static com.amazon.randomcutforest.CommonUtils.toDoubleArray;
import static com.amazon.randomcutforest.RandomCutForest.DEFAULT_BOUNDING_BOX_CACHE_FRACTION;
import static com.amazon.randomcutforest.RandomCutForest.DEFAULT_CENTER_OF_MASS_ENABLED;
import static com.amazon.randomcutforest.RandomCutForest.DEFAULT_INITIAL_ACCEPT_FRACTION;
import static com.amazon.randomcutforest.RandomCutForest.DEFAULT_NUMBER_OF_TREES;
import static com.amazon.randomcutforest.RandomCutForest.DEFAULT_OUTPUT_AFTER_FRACTION;
import static com.amazon.randomcutforest.RandomCutForest.DEFAULT_PARALLEL_EXECUTION_ENABLED;
import static com.amazon.randomcutforest.RandomCutForest.DEFAULT_SAMPLE_SIZE;
import static com.amazon.randomcutforest.RandomCutForest.DEFAULT_SHINGLE_SIZE;
import static com.amazon.randomcutforest.RandomCutForest.DEFAULT_STORE_SEQUENCE_INDEXES_ENABLED;
import static com.amazon.randomcutforest.config.ImputationMethod.PREVIOUS;
import static com.amazon.randomcutforest.preprocessor.Preprocessor.DEFAULT_START_NORMALIZATION;
import static com.amazon.randomcutforest.preprocessor.Preprocessor.DEFAULT_STOP_NORMALIZATION;
import static java.lang.Math.max;
import static java.lang.Math.min;

import java.util.Arrays;
import java.util.Optional;
import java.util.Random;

import com.amazon.randomcutforest.config.ForestMode;
import com.amazon.randomcutforest.config.ImputationMethod;
import com.amazon.randomcutforest.config.TransformMethod;
import com.amazon.randomcutforest.preprocessor.IPreprocessor;
import com.amazon.randomcutforest.preprocessor.Preprocessor;
import com.amazon.randomcutforest.returntypes.DensityOutput;
import com.amazon.randomcutforest.returntypes.DiVector;
import com.amazon.randomcutforest.returntypes.InterpolationMeasure;
import com.amazon.randomcutforest.returntypes.SampleSummary;

/**
 * This class provides a predictive imputation based on RCF (respecting the
 * arrow of time) alongside streaming normalization
 *
 * Many of these capabities existed since RCF 1.0 -- however it seems that
 * abstracting them into a single collected class can avoid the messier details
 * and make the capabilites more accessible.
 *
 * We reiterate the observation in
 * <a href="https://opensearch.org/blog/random-cut-forests/">
 * https://opensearch.org/blog/random-cut-forests/</a> that an unsupervised
 * anomaly detection that infers "not normal" can be made to predict, "well,
 * what is normal then"? That is the basis of the time series forecasting in
 * RCFCaster in parkservices -- one can predict the most likely (approximately
 * minimum not normal score) value. The clustering inherent in RCF (for example,
 * see getRCFDistanceAttribution as an alternate scoring metric) and other
 * multicentroid methods can be then utilized to expose clusters of "likely"
 * values.
 *
 */
public class PredictiveRandomCutForest {

    protected TransformMethod transformMethod = TransformMethod.NORMALIZE;

    protected RandomCutForest forest;

    protected IPreprocessor preprocessor;

    protected ForestMode forestMode = ForestMode.STANDARD;

    public PredictiveRandomCutForest(Builder<?> builder) {
        transformMethod = builder.transformMethod;
        Preprocessor.Builder<?> preprocessorBuilder = Preprocessor.builder().shingleSize(builder.shingleSize)
                .transformMethod(builder.transformMethod).forestMode(builder.forestMode);

        int dimensions = builder.inputDimensions * builder.shingleSize;
        if (builder.forestMode == ForestMode.TIME_AUGMENTED) {
            dimensions += builder.shingleSize;
            // if time is not differenced, then it can be added as a column
            // without much difficulty
            preprocessorBuilder.normalizeTime(true);
            // force internal shingling for this option
            builder.internalShinglingEnabled = Optional.of(true);
        } else if (builder.forestMode == ForestMode.STREAMING_IMPUTE) {
            preprocessorBuilder.normalizeTime(true);
            builder.internalShinglingEnabled = Optional.of(true);
            preprocessorBuilder.imputationMethod(builder.imputationMethod);
            if (builder.fillValues != null) {
                preprocessorBuilder.fillValues(builder.fillValues);
            }
            preprocessorBuilder.useImputedFraction(builder.useImputedFraction.orElse(0.5));
        } else {
            builder.internalShinglingEnabled = Optional.of(true);
        }

        forestMode = builder.forestMode;
        forest = builder.buildForest();
        validateNonNegativeArray(builder.weights);

        preprocessorBuilder.inputLength(builder.inputDimensions);
        preprocessorBuilder.weights(builder.weights);
        preprocessorBuilder.weightTime(builder.weightTime.orElse(1.0));
        preprocessorBuilder.transformDecay(builder.transformDecay.orElse(1.0 / builder.sampleSize));
        // to be used later
        preprocessorBuilder.randomSeed(builder.randomSeed.orElse(0L) + 1);
        preprocessorBuilder.dimensions(dimensions);
        preprocessorBuilder.stopNormalization(builder.stopNormalization.orElse(DEFAULT_STOP_NORMALIZATION));
        preprocessorBuilder.startNormalization(builder.startNormalization.orElse(DEFAULT_START_NORMALIZATION));

        preprocessor = preprocessorBuilder.build();
    }

    public PredictiveRandomCutForest(ForestMode forestMode, TransformMethod method, IPreprocessor preprocessor,
            RandomCutForest forest) {
        this.forestMode = forestMode;
        this.transformMethod = method;
        this.preprocessor = preprocessor;
        this.forest = forest;
    }

    void validateNonNegativeArray(double[] array) {
        if (array != null) {
            for (double element : array) {
                checkArgument(element >= 0, " has to be non-negative");
            }
        }
    }

    /**
     * The following function provides a clustering of the predicted near neighbors
     * of the input point. Note that all of these functions were always available in
     * RCF
     * 
     * @param inputPoint              the input point, can have missing values
     * @param timestamp               the timestamp for the input -- not useful
     *                                unless we are using TIME_AUGMENTED mode or
     *                                STREAMING_IMPUTE (for time series)
     * @param missingValues           an integer array with the positions in
     *                                inputPoint which are unknown
     * @param numberOfRepresentatives a parameter that controls multi-centroid
     *                                clustering of the (predicted) neighbors -- 5
     *                                is a good default. Setting this as 1 would
     *                                have a behavior similar to (but perhaps still
     *                                better than) k-means
     * @param shrinkage               a parameter that controls the shape of the
     *                                clusters -- 1 would indicate behavior similar
     *                                to centroids
     * @param centrality              a parameter in [0:1] that controls the
     *                                randomization/diversity in the prediction -- a
     *                                value of 1 would correspond to p50 predictions
     *                                and a value of 0 would correspond to looser
     *                                random search
     * @return a SampleSummary of the near neighbors in the same dimension as the
     *         input (unless TIME_AUGMENTED, when the dimension increases by 1.
     */
    public SampleSummary predict(float[] inputPoint, long timestamp, int[] missingValues, int numberOfRepresentatives,
            double shrinkage, double centrality) {
        checkArgument(inputPoint.length == preprocessor.getInputLength(), "incorrect length");
        int[] newMissingValues = new int[0]; // avoiding null; allows missingvalues to be null
        if (missingValues != null) {
            checkArgument(missingValues.length <= inputPoint.length, " incorrect data");
            newMissingValues = new int[missingValues.length];
            int startPosition = forest.getDimensions() - forest.getDimensions() / preprocessor.getShingleSize();
            for (int i = 0; i < missingValues.length; i++) {
                checkArgument(missingValues[i] >= 0, " missing values cannot be at negative position");
                checkArgument(missingValues[i] <= inputPoint.length,
                        "missing values cannot be at position larger than input length");
                checkArgument(forestMode == ForestMode.TIME_AUGMENTED || missingValues[i] < inputPoint.length,
                        "cannot be equal to input length");
                newMissingValues[i] = (forestMode == ForestMode.STREAMING_IMPUTE) ? startPosition + missingValues[i]
                        : missingValues[i];
            }
        }
        // check when TIME_AUGMENTED and missingValue includes timestamp
        float[] point = preprocessor.getScaledShingledInput(toDoubleArray(inputPoint), timestamp, missingValues,
                forest);
        if (point == null) {
            return new SampleSummary(preprocessor.getInputLength());
        }
        return preprocessor.invertInPlaceRecentSummaryBlock(forest.getConditionalFieldSummary(point, newMissingValues,
                numberOfRepresentatives, shrinkage, true, false, centrality, preprocessor.getShingleSize()));
    }

    public SampleSummary predict(float[] inputPoint, long timestamp, int[] missingValues) {
        return predict(inputPoint, timestamp, missingValues, 5, 0.3, 0.5);
    }

    /**
     * Near neighbors is an extreme example of prediction where there aare no
     * missing values
     * 
     * @param inputPoint the input
     * @param timestamp  the timestamp (not used unless for TIME_AUGMENTED and
     *                   STREAMING_IMPUTE)
     * @return returns a clustering of the near neighbors in the (time decaying)
     *         sample maintained by RCF
     */
    public SampleSummary neighborSummary(float[] inputPoint, long timestamp) {
        return predict(inputPoint, timestamp, null, 1, 0, 1);
    }

    /**
     * This is the anomalyScore() function in RCF -- that definition of score has
     * diverged from the original paper and perhaps the more descriptive name is
     * more useful. Note that it is important that this is Expectation of Inverse
     * versus Inverse of Expectation -- a la Jensen's Inequality.
     * 
     * @param inputPoint the input point
     * @param timestamp  the timestamp
     * @return a score in the range (0:log_2(sampleSize)) where larger values
     *         indicate potential anomalies. Note that the score can remain elevated
     *         due to shingling for a while -- use
     *         ParkServices/ThresholdedRandomCutForest where the PredictorCorrector
     *         architecture is used to evaluate the score further and produce a more
     *         refined anomalyGrade()in [0:1] ; including setting the grade to 0
     *         (corrector) even though the score (of this function) is high.
     */
    public double getExpectedInverseDepthScore(float[] inputPoint, long timestamp) {
        checkArgument(inputPoint.length == preprocessor.getInputLength(), "incorrect length");
        float[] point = preprocessor.getScaledShingledInput(toDoubleArray(inputPoint), timestamp, null, forest);
        return (point != null) ? forest.getAnomalyScore(point) : 0;
    }

    /**
     * Same as above -- but now the subparts of the score are exposed in the full
     * RCF space which is inputDimension (add +1 for TIME_AUGMENTED) times the
     * shingleSize. For each of these, the score can arise from the input value
     * being HIGH or LOW (as determined by the ensemble of trees) -- which is
     * returned in the DiVector structure. This is extremely useful in pinpointing
     * which attribute or which value in the shingle was likely indicator of the
     * anomaly, and is used exactly such in PredictorCorrector in ParkServices. This
     * function enables the use of PreProcessor.
     * 
     * @param inputPoint the input point
     * @param timestamp  the timestamp for the point (used only in TIME_AUGMENTED
     *                   and STREAMING_IMPUTE)
     * @return a divector such that getHighLowSum() would equal (up to floating
     *         point precision over summing values across the dimensions in RCF
     *         space) the value of getExpectedInverseDepthScore()
     */
    public DiVector getExpectedInverseDepthAttribution(float[] inputPoint, long timestamp) {
        checkArgument(inputPoint.length == preprocessor.getInputLength(), "incorrect length");
        float[] point = preprocessor.getScaledShingledInput(toDoubleArray(inputPoint), timestamp, null, forest);
        return (point != null) ? forest.getAnomalyAttribution(point) : new DiVector(forest.getDimensions());
    }

    /**
     * One of the visions for RCF (see blog above) was that the same data structure
     * that can compute anomaly scores somewhat effectively, also has information
     * regarding other measures (say X) of the point set -- and if that measure X
     * also is indicative of anomaly then RCF should be able to vend X. One such
     * example is density around a point set and this was available in RCF and is
     * carried over here. It is primarily used via the DISTANCE_MODE computation in
     * ScoringStrategy in ParkServices. This function enables the use of
     * preprocessor.
     * 
     * @param inputPoint the input point
     * @param timestamp  the timestamp of the current point
     * @return a density output structure -- see
     *         examples/dynamicinference/dynamicdensity
     */
    public DensityOutput getSimpleDensity(float[] inputPoint, long timestamp) {
        checkArgument(inputPoint.length == preprocessor.getInputLength(), "incorrect length");
        float[] scaled = preprocessor.getScaledShingledInput(toDoubleArray(inputPoint), timestamp, null, forest);
        DensityOutput answer = (scaled != null) ? forest.getSimpleDensity(scaled)
                : new DensityOutput(new InterpolationMeasure(inputPoint.length, 0));
        double[] scale = preprocessor.getScale();
        for (int i = 0; i < answer.getDimensions(); i++) {
            answer.distances.high[i] *= scale[i % scale.length];
            answer.distances.low[i] *= scale[i % scale.length];
        }
        return answer;
    }

    /**
     * The following provides an alternate scoring (as well as exposing the subparts
     * of the computation) based on the density output. The function getHighLowSum()
     * would correspond to a score (where higher corresponds to more unlikely
     * behavior). This is based on the recursive partitioning in the RCF trees and
     * the fact that they preserve distances -- this is used in DISTANCE_MODE and
     * MULTI_MODE in ParkService/ThresholdedRandomCutForest See the example
     * parkservices/NumericGLADExample
     * 
     * @param inputPoint the input point
     * @param timestamp  the timestamp of the point
     * @return a divector in RCF space of size inputDimension (add +1 for
     *         TIME_AUGMENTED) times the shingleSize; with the same interpretation
     *         in getExpectedInverseDepthAttribution(). This score is not calibrated
     *         to be in any bounded ranges, and should perhaps be used as a
     *         corroborative signal with getExpectedInverseDepthAttribution
     */
    public DiVector getRCFDistanceAttribution(float[] inputPoint, long timestamp) {
        DensityOutput test = getSimpleDensity(inputPoint, timestamp);
        return test.distances;
    }

    public void update(float[] record, long timestamp) {
        update(record, timestamp, null);
    }

    public void update(float[] record, long timestamp, int[] missing) {
        float[] scaled = preprocessor.getScaledShingledInput(toDoubleArray(record), timestamp, missing, forest);
        preprocessor.update(toDoubleArray(record), scaled, timestamp, missing, forest);
    }

    public RandomCutForest getForest() {
        return forest;
    }

    public IPreprocessor getPreprocessor() {
        return preprocessor;
    }

    public ForestMode getForestMode() {
        return forestMode;
    }

    public TransformMethod getTransformMethod() {
        return transformMethod;
    }

    /**
     * @return a new builder.
     */
    public static Builder<?> builder() {
        return new Builder<>();
    }

    public static class Builder<T extends Builder<T>> {

        // We use Optional types for optional primitive fields when it doesn't make
        // sense to use a constant default.

        protected int inputDimensions;
        protected int sampleSize = DEFAULT_SAMPLE_SIZE;
        protected Optional<Integer> outputAfter = Optional.empty();
        protected Optional<Integer> startNormalization = Optional.empty();
        protected Optional<Integer> stopNormalization = Optional.empty();
        protected int numberOfTrees = DEFAULT_NUMBER_OF_TREES;
        protected Optional<Double> timeDecay = Optional.empty();
        protected Optional<Double> lowerThreshold = Optional.empty();
        protected Optional<Double> weightTime = Optional.empty();
        protected boolean normalizeTime = true;
        protected Optional<Long> randomSeed = Optional.empty();
        protected boolean storeSequenceIndexesEnabled = DEFAULT_STORE_SEQUENCE_INDEXES_ENABLED;
        protected boolean centerOfMassEnabled = DEFAULT_CENTER_OF_MASS_ENABLED;
        protected boolean parallelExecutionEnabled = DEFAULT_PARALLEL_EXECUTION_ENABLED;
        protected Optional<Integer> threadPoolSize = Optional.empty();
        protected double boundingBoxCacheFraction = DEFAULT_BOUNDING_BOX_CACHE_FRACTION;
        protected int shingleSize = DEFAULT_SHINGLE_SIZE;
        protected Optional<Boolean> internalShinglingEnabled = Optional.empty();
        protected double initialAcceptFraction = DEFAULT_INITIAL_ACCEPT_FRACTION;
        protected TransformMethod transformMethod = TransformMethod.NONE;
        protected ImputationMethod imputationMethod = PREVIOUS;
        protected ForestMode forestMode = ForestMode.STANDARD;
        protected double[] weights = null;
        protected double[] fillValues = null;
        protected Optional<Double> useImputedFraction = Optional.empty();
        protected Optional<Double> transformDecay = Optional.empty();

        void validate() {
            if (forestMode == ForestMode.TIME_AUGMENTED) {
                if (internalShinglingEnabled.isPresent()) {
                    checkArgument(shingleSize == 1 || internalShinglingEnabled.get(),
                            " shingle size has to be 1 or " + "internal shingling must turned on");
                    checkArgument(transformMethod == TransformMethod.NONE || internalShinglingEnabled.get(),
                            " internal shingling must turned on for transforms");
                } else {
                    internalShinglingEnabled = Optional.of(true);
                }
                if (useImputedFraction.isPresent()) {
                    throw new IllegalArgumentException(" imputation infeasible");
                }
            } else if (forestMode == ForestMode.STREAMING_IMPUTE) {
                checkArgument(shingleSize > 1, "imputation with shingle size 1 is not meaningful");
                internalShinglingEnabled.ifPresent(x -> checkArgument(x,
                        " input cannot be shingled (even if internal representation is different) "));
            } else {
                if (!internalShinglingEnabled.isPresent()) {
                    internalShinglingEnabled = Optional.of(true);
                }
                if (useImputedFraction.isPresent()) {
                    throw new IllegalArgumentException(" imputation infeasible");
                }
            }
            if (startNormalization.isPresent()) {
                // we should not be setting normalizations unless we are careful
                if (outputAfter.isPresent()) {
                    // can be overspecified
                    checkArgument(outputAfter.get() + shingleSize - 1 > startNormalization.get(),
                            "output after has to wait till normalization, reduce normalization");
                } else {
                    int n = startNormalization.get();
                    checkArgument(n > 0, " startNormalization has to be positive");
                    // if start normalization is low then first few output can be 0
                    outputAfter = Optional
                            .of(max(max(1, (int) (sampleSize * DEFAULT_OUTPUT_AFTER_FRACTION)), n - shingleSize + 1));
                }
            } else {
                if (outputAfter.isPresent()) {
                    startNormalization = Optional.of(min(DEFAULT_START_NORMALIZATION, outputAfter.get()));
                }
            }
        }

        public PredictiveRandomCutForest build() {
            validate();
            return new PredictiveRandomCutForest(this);
        }

        protected RandomCutForest buildForest() {
            int dimensions = inputDimensions * shingleSize
                    + ((forestMode == ForestMode.TIME_AUGMENTED) ? shingleSize : 0);
            RandomCutForest.Builder builder = new RandomCutForest.Builder().dimensions(dimensions)
                    .sampleSize(sampleSize).numberOfTrees(numberOfTrees)
                    .storeSequenceIndexesEnabled(storeSequenceIndexesEnabled).centerOfMassEnabled(centerOfMassEnabled)
                    .parallelExecutionEnabled(parallelExecutionEnabled)
                    .boundingBoxCacheFraction(boundingBoxCacheFraction).shingleSize(shingleSize)
                    .internalShinglingEnabled(internalShinglingEnabled.get())
                    .initialAcceptFraction(initialAcceptFraction);

            outputAfter.ifPresent(builder::outputAfter);
            timeDecay.ifPresent(builder::timeDecay);
            randomSeed.ifPresent(builder::randomSeed);
            threadPoolSize.ifPresent(builder::threadPoolSize);
            return builder.build();
        }

        public T inputDimensions(int dimensions) {
            this.inputDimensions = dimensions;
            return (T) this;
        }

        public T sampleSize(int sampleSize) {
            this.sampleSize = sampleSize;
            return (T) this;
        }

        public T startNormalization(int startNormalization) {
            this.startNormalization = Optional.of(startNormalization);
            return (T) this;
        }

        public T stopNormalization(int stopNormalization) {
            this.stopNormalization = Optional.of(stopNormalization);
            return (T) this;
        }

        public T outputAfter(int outputAfter) {
            this.outputAfter = Optional.of(outputAfter);
            return (T) this;
        }

        public T numberOfTrees(int numberOfTrees) {
            this.numberOfTrees = numberOfTrees;
            return (T) this;
        }

        public T shingleSize(int shingleSize) {
            this.shingleSize = shingleSize;
            return (T) this;
        }

        public T timeDecay(double timeDecay) {
            this.timeDecay = Optional.of(timeDecay);
            return (T) this;
        }

        public T transformDecay(double transformDecay) {
            this.transformDecay = Optional.of(transformDecay);
            return (T) this;
        }

        public T randomSeed(long randomSeed) {
            this.randomSeed = Optional.of(randomSeed);
            return (T) this;
        }

        public T centerOfMassEnabled(boolean centerOfMassEnabled) {
            this.centerOfMassEnabled = centerOfMassEnabled;
            return (T) this;
        }

        public T parallelExecutionEnabled(boolean parallelExecutionEnabled) {
            this.parallelExecutionEnabled = parallelExecutionEnabled;
            return (T) this;
        }

        public T forestMode(ForestMode forestMode) {
            this.forestMode = forestMode;
            return (T) this;
        }

        public T threadPoolSize(int threadPoolSize) {
            this.threadPoolSize = Optional.of(threadPoolSize);
            return (T) this;
        }

        public T storeSequenceIndexesEnabled(boolean storeSequenceIndexesEnabled) {
            this.storeSequenceIndexesEnabled = storeSequenceIndexesEnabled;
            return (T) this;
        }

        public T boundingBoxCacheFraction(double boundingBoxCacheFraction) {
            this.boundingBoxCacheFraction = boundingBoxCacheFraction;
            return (T) this;
        }

        public T initialAcceptFraction(double initialAcceptFraction) {
            this.initialAcceptFraction = initialAcceptFraction;
            return (T) this;
        }

        public Random getRandom() {
            // If a random seed was given, use it to create a new Random. Otherwise, call
            // the 0-argument constructor
            return randomSeed.map(Random::new).orElseGet(Random::new);
        }

        public T weights(double[] values) {
            // values cannot be a null
            this.weights = Arrays.copyOf(values, values.length);
            return (T) this;
        }

        public T imputationMethod(ImputationMethod imputationMethod) {
            this.imputationMethod = imputationMethod;
            return (T) this;
        }

        public T transformMethod(TransformMethod method) {
            this.transformMethod = method;
            return (T) this;
        }

        public T fillValues(double[] values) {
            // values cannot be a null
            this.fillValues = Arrays.copyOf(values, values.length);
            return (T) this;
        }

        public T useImputedFraction(double fraction) {
            this.useImputedFraction = Optional.of(fraction);
            return (T) this;
        }

        public T weightTime(double value) {
            this.weightTime = Optional.of(value);
            return (T) this;
        }

        public T normalizeTime(boolean normalizeTime) {
            this.normalizeTime = normalizeTime;
            return (T) this;
        }
    }
}


================================================
FILE: Java/core/src/main/java/com/amazon/randomcutforest/RandomCutForest.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import static com.amazon.randomcutforest.CommonUtils.checkArgument;
import static com.amazon.randomcutforest.CommonUtils.checkNotNull;
import static com.amazon.randomcutforest.CommonUtils.toDoubleArray;
import static com.amazon.randomcutforest.CommonUtils.toFloatArray;
import static com.amazon.randomcutforest.summarization.Summarizer.DEFAULT_SEPARATION_RATIO_FOR_MERGE;
import static java.lang.Math.max;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.Random;
import java.util.function.BiFunction;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.stream.Collector;

import com.amazon.randomcutforest.anomalydetection.AnomalyAttributionVisitor;
import com.amazon.randomcutforest.anomalydetection.AnomalyScoreVisitor;
import com.amazon.randomcutforest.anomalydetection.DynamicAttributionVisitor;
import com.amazon.randomcutforest.anomalydetection.DynamicScoreVisitor;
import com.amazon.randomcutforest.anomalydetection.SimulatedTransductiveScalarScoreVisitor;
import com.amazon.randomcutforest.config.Config;
import com.amazon.randomcutforest.config.Precision;
import com.amazon.randomcutforest.executor.AbstractForestTraversalExecutor;
import com.amazon.randomcutforest.executor.AbstractForestUpdateExecutor;
import com.amazon.randomcutforest.executor.IStateCoordinator;
import com.amazon.randomcutforest.executor.ParallelForestTraversalExecutor;
import com.amazon.randomcutforest.executor.ParallelForestUpdateExecutor;
import com.amazon.randomcutforest.executor.PointStoreCoordinator;
import com.amazon.randomcutforest.executor.SamplerPlusTree;
import com.amazon.randomcutforest.executor.SequentialForestTraversalExecutor;
import com.amazon.randomcutforest.executor.SequentialForestUpdateExecutor;
import com.amazon.randomcutforest.imputation.ConditionalSampleSummarizer;
import com.amazon.randomcutforest.imputation.ImputeVisitor;
import com.amazon.randomcutforest.inspect.NearNeighborVisitor;
import com.amazon.randomcutforest.interpolation.SimpleInterpolationVisitor;
import com.amazon.randomcutforest.returntypes.ConditionalTreeSample;
import com.amazon.randomcutforest.returntypes.ConvergingAccumulator;
import com.amazon.randomcutforest.returntypes.DensityOutput;
import com.amazon.randomcutforest.returntypes.DiVector;
import com.amazon.randomcutforest.returntypes.InterpolationMeasure;
import com.amazon.randomcutforest.returntypes.Neighbor;
import com.amazon.randomcutforest.returntypes.OneSidedConvergingDiVectorAccumulator;
import com.amazon.randomcutforest.returntypes.OneSidedConvergingDoubleAccumulator;
import com.amazon.randomcutforest.returntypes.RangeVector;
import com.amazon.randomcutforest.returntypes.SampleSummary;
import com.amazon.randomcutforest.sampler.CompactSampler;
import com.amazon.randomcutforest.sampler.IStreamSampler;
import com.amazon.randomcutforest.store.IPointStore;
import com.amazon.randomcutforest.store.PointStore;
import com.amazon.randomcutforest.summarization.ICluster;
import com.amazon.randomcutforest.summarization.Summarizer;
import com.amazon.randomcutforest.tree.IBoundingBoxView;
import com.amazon.randomcutforest.tree.ITree;
import com.amazon.randomcutforest.tree.RandomCutTree;
import com.amazon.randomcutforest.util.ShingleBuilder;

/**
 * The RandomCutForest class is the interface to the algorithms in this package,
 * and includes methods for anomaly detection, anomaly detection with
 * attribution, density estimation, imputation, and forecasting. A Random Cut
 * Forest is a collection of Random Cut Trees and stream samplers. When an
 * update call is made to a Random Cut Forest, each sampler is independently
 * updated with the submitted (and if the point is accepted by the sampler, then
 * the corresponding Random Cut Tree is also updated. Similarly, when an
 * algorithm method is called, the Random Cut Forest proxies to the trees which
 * implement the actual scoring logic. The Random Cut Forest then combines
 * partial results into a final results.
 */
public class RandomCutForest {

    /**
     * Default sample size. This is the number of points retained by the stream
     * sampler.
     */
    public static final int DEFAULT_SAMPLE_SIZE = 256;

    /**
     * Default fraction used to compute the amount of points required by stream
     * samplers before results are returned.
     */
    public static final double DEFAULT_OUTPUT_AFTER_FRACTION = 0.25;

    /**
     * If the user doesn't specify an explicit time decay value, then we set it to
     * the inverse of this coefficient times sample size.
     */
    public static final double DEFAULT_SAMPLE_SIZE_COEFFICIENT_IN_TIME_DECAY = 10.0;

    /**
     * Default number of trees to use in the forest.
     */
    public static final int DEFAULT_NUMBER_OF_TREES = 50;

    /**
     * By default, trees will not store sequence indexes.
     */
    public static final boolean DEFAULT_STORE_SEQUENCE_INDEXES_ENABLED = false;

    /**
     * By default, trees will accept every point until full.
     */
    public static final double DEFAULT_INITIAL_ACCEPT_FRACTION = 1.0;

    /**
     * By default, the collection of points stored in the forest will increase from
     * a small size, as needed to maximum capacity
     */
    public static final boolean DEFAULT_DYNAMIC_RESIZING_ENABLED = true;

    /**
     * By default, shingling will be external
     */
    public static final boolean DEFAULT_INTERNAL_SHINGLING_ENABLED = false;

    /**
     * By default, shingles will be a sliding window and not a cyclic buffer
     */
    public static final boolean DEFAULT_INTERNAL_ROTATION_ENABLED = false;

    /**
     * By default, point stores will favor speed of size for larger shingle sizes
     */
    public static final boolean DEFAULT_DIRECT_LOCATION_MAP = false;

    /**
     * Default floating-point precision for internal data structures.
     */
    public static final Precision DEFAULT_PRECISION = Precision.FLOAT_32;

    /**
     * fraction of bounding boxes maintained by each tree
     */
    public static final double DEFAULT_BOUNDING_BOX_CACHE_FRACTION = 1.0;

    /**
     * By default, nodes will not store center of mass.
     */
    public static final boolean DEFAULT_CENTER_OF_MASS_ENABLED = false;

    /**
     * By default RCF is unaware of shingle size
     */
    public static final int DEFAULT_SHINGLE_SIZE = 1;

    /**
     * Parallel execution is enabled by default.
     */
    public static final boolean DEFAULT_PARALLEL_EXECUTION_ENABLED = false;

    public static final boolean DEFAULT_APPROXIMATE_ANOMALY_SCORE_HIGH_IS_CRITICAL = true;

    public static final double DEFAULT_APPROXIMATE_DYNAMIC_SCORE_PRECISION = 0.1;

    public static final int DEFAULT_APPROXIMATE_DYNAMIC_SCORE_MIN_VALUES_ACCEPTED = 5;

    /**
     * Random number generator used by the forest.
     */
    protected Random random;
    /**
     * The number of dimensions in the input data.
     */
    protected final int dimensions;
    /**
     * The sample size used by stream samplers in this forest.
     */
    protected final int sampleSize;
    /**
     * The shingle size (if known)
     */
    protected final int shingleSize;
    /**
     * The input dimensions for known shingle size and internal shingling
     */
    protected final int inputDimensions;
    /**
     * The number of points required by stream samplers before results are returned.
     */
    protected final int outputAfter;
    /**
     * The number of trees in this forest.
     */
    protected final int numberOfTrees;
    /**
     * The decay factor used by stream samplers in this forest.
     */
    protected double timeDecay;
    /**
     * Store the time information
     */
    protected final boolean storeSequenceIndexesEnabled;

    /**
     * enables internal shingling
     */
    protected final boolean internalShinglingEnabled;

    /**
     * The following can be set between 0 and 1 (inclusive) to achieve tradeoff
     * between smaller space, lower throughput and larger space, larger throughput
     */
    protected final double boundingBoxCacheFraction;
    /**
     * Enable center of mass at internal nodes
     */
    protected final boolean centerOfMassEnabled;
    /**
     * Enable parallel execution.
     */
    protected final boolean parallelExecutionEnabled;
    /**
     * Number of threads to use in the thread pool if parallel execution is enabled.
     */
    protected final int threadPoolSize;
    /**
     * A string to define an "execution mode" that can be used to set multiple
     * configuration options. This field is not currently in use.
     */
    protected String executionMode;

    protected IStateCoordinator<?, float[]> stateCoordinator;
    protected ComponentList<?, float[]> components;

    /**
     * This flag is initialized to false. It is set to true when all component
     * models are ready.
     */
    private boolean outputReady;

    /**
     * used for initializing the compact forests
     */
    private final int initialPointStoreSize;
    private final int pointStoreCapacity;

    /**
     * An implementation of forest traversal algorithms.
     */
    protected AbstractForestTraversalExecutor traversalExecutor;

    /**
     * An implementation of forest update algorithms.
     */
    protected AbstractForestUpdateExecutor<?, float[]> updateExecutor;

    public <P> RandomCutForest(Builder<?> builder, IStateCoordinator<P, float[]> stateCoordinator,
            ComponentList<P, float[]> components, Random random) {
        this(builder, false);

        checkNotNull(stateCoordinator, "updateCoordinator must not be null");
        checkNotNull(components, "componentModels must not be null");
        checkNotNull(random, "random must not be null");

        this.stateCoordinator = stateCoordinator;
        this.components = components;
        this.random = random;
        initExecutors(stateCoordinator, components);
    }

    public RandomCutForest(Builder<?> builder) {
        this(builder, false);
        random = builder.getRandom();

        PointStore tempStore = PointStore.builder().internalRotationEnabled(builder.internalRotationEnabled)
                .capacity(pointStoreCapacity).initialSize(initialPointStoreSize)
                .internalShinglingEnabled(internalShinglingEnabled).shingleSize(shingleSize).dimensions(dimensions)
                .build();

        IStateCoordinator<Integer, float[]> stateCoordinator = new PointStoreCoordinator<>(tempStore);
        ComponentList<Integer, float[]> components = new ComponentList<>(numberOfTrees);
        for (int i = 0; i < numberOfTrees; i++) {
            ITree<Integer, float[]> tree = new RandomCutTree.Builder().capacity(sampleSize)
                    .randomSeed(random.nextLong()).pointStoreView(tempStore)
                    .boundingBoxCacheFraction(boundingBoxCacheFraction).centerOfMassEnabled(centerOfMassEnabled)
                    .storeSequenceIndexesEnabled(storeSequenceIndexesEnabled).outputAfter(1).build();

            IStreamSampler<Integer> sampler = CompactSampler.builder().capacity(sampleSize).timeDecay(timeDecay)
                    .randomSeed(random.nextLong()).storeSequenceIndexesEnabled(storeSequenceIndexesEnabled)
                    .initialAcceptFraction(builder.initialAcceptFraction).build();

            components.add(new SamplerPlusTree<>(sampler, tree));
        }
        this.stateCoordinator = stateCoordinator;
        this.components = components;
        initExecutors(stateCoordinator, components);
    }

    protected <PointReference> void initExecutors(IStateCoordinator<PointReference, float[]> updateCoordinator,
            ComponentList<PointReference, float[]> components) {
        if (parallelExecutionEnabled) {
            traversalExecutor = new ParallelForestTraversalExecutor(components, threadPoolSize);
            updateExecutor = new ParallelForestUpdateExecutor<>(updateCoordinator, components, threadPoolSize);
        } else {
            traversalExecutor = new SequentialForestTraversalExecutor(components);
            updateExecutor = new SequentialForestUpdateExecutor<>(updateCoordinator, components);
        }
    }

    /**
     * This constructor is responsible for initializing a forest's configuration
     * variables from a builder. The method signature contains a boolean argument
     * that isn't used. This argument exists only to create a distinct method
     * signature so that we can expose {@link #RandomCutForest(Builder)} as a
     * protected constructor.
     * 
     * @param builder A Builder instance giving the desired random cut forest
     *                configuration.
     * @param notUsed This parameter is not used.
     */
    protected RandomCutForest(Builder<?> builder, boolean notUsed) {
        checkArgument(builder.numberOfTrees > 0, "numberOfTrees must be greater than 0");
        checkArgument(builder.sampleSize > 0, "sampleSize must be greater than 0");
        builder.outputAfter.ifPresent(n -> checkArgument(n > 0, "outputAfter must be greater than 0"));
        checkArgument(builder.dimensions > 0, "dimensions must be greater than 0");
        builder.timeDecay
                .ifPresent(timeDecay -> checkArgument(timeDecay >= 0, "timeDecay must be greater than or equal to 0"));
        builder.threadPoolSize.ifPresent(n -> {
            checkArgument(n >= 0, "cannot be negative");
            checkArgument((n > 0) || (!builder.parallelExecutionEnabled),
                    "threadPoolSize must be greater/equal than 0. To disable thread pool, set parallel execution to 'false'.");
        });
        checkArgument(builder.shingleSize == 1 || builder.dimensions % builder.shingleSize == 0, "wrong shingle size");
        if (builder.internalRotationEnabled) {
            checkArgument(builder.internalShinglingEnabled, " enable internal shingling");
        }
        builder.initialPointStoreSize
                .ifPresent(n -> checkArgument(n > 0, "initial point store must be greater than 0"));
        checkArgument(builder.boundingBoxCacheFraction >= 0, "cache cannot be negative");
        checkArgument(builder.boundingBoxCacheFraction <= 1, "incorrect cache fraction range");
        numberOfTrees = builder.numberOfTrees;
        sampleSize = builder.sampleSize;
        outputAfter = builder.outputAfter.orElse(max(1, (int) (sampleSize * DEFAULT_OUTPUT_AFTER_FRACTION)));
        internalShinglingEnabled = builder.internalShinglingEnabled;
        shingleSize = builder.shingleSize;
        dimensions = builder.dimensions;
        timeDecay = builder.timeDecay.orElse(1.0 / (DEFAULT_SAMPLE_SIZE_COEFFICIENT_IN_TIME_DECAY * sampleSize));
        storeSequenceIndexesEnabled = builder.storeSequenceIndexesEnabled;
        centerOfMassEnabled = builder.centerOfMassEnabled;
        parallelExecutionEnabled = builder.parallelExecutionEnabled;
        boundingBoxCacheFraction = builder.boundingBoxCacheFraction;
        builder.directLocationMapEnabled = builder.directLocationMapEnabled || shingleSize == 1;
        inputDimensions = (internalShinglingEnabled) ? dimensions / shingleSize : dimensions;
        pointStoreCapacity = max(sampleSize * numberOfTrees + 1, 2 * sampleSize);
        initialPointStoreSize = builder.initialPointStoreSize.orElse(2 * sampleSize);

        if (parallelExecutionEnabled) {
            threadPoolSize = builder.threadPoolSize.orElse(Runtime.getRuntime().availableProcessors() - 1);
        } else {
            threadPoolSize = 0;
        }
    }

    /**
     * @return a new RandomCutForest builder.
     */
    public static Builder builder() {
        return new Builder();
    }

    /**
     * Create a new RandomCutForest with optional arguments set to default values.
     *
     * @param dimensions The number of dimension in the input data.
     * @param randomSeed The random seed to use to create the forest random number
     *                   generator
     * @return a new RandomCutForest with optional arguments set to default values.
     */
    public static RandomCutForest defaultForest(int dimensions, long randomSeed) {
        return builder().dimensions(dimensions).randomSeed(randomSeed).build();
    }

    /**
     * Create a new RandomCutForest with optional arguments set to default values.
     *
     * @param dimensions The number of dimension in the input data.
     * @return a new RandomCutForest with optional arguments set to default values.
     */
    public static RandomCutForest defaultForest(int dimensions) {
        return builder().dimensions(dimensions).build();
    }

    /**
     * @return the number of trees in the forest.
     */
    public int getNumberOfTrees() {
        return numberOfTrees;
    }

    /**
     * @return the sample size used by stream samplers in this forest.
     */
    public int getSampleSize() {
        return sampleSize;
    }

    /**
     * @return the shingle size used by the point store.
     */
    public int getShingleSize() {
        return shingleSize;
    }

    /**
     * @return the number of points required by stream samplers before results are
     *         returned.
     */
    public int getOutputAfter() {
        return outputAfter;
    }

    /**
     * @return the number of dimensions in the data points accepted by this forest.
     */
    public int getDimensions() {
        return dimensions;
    }

    /**
     * @return return the decay factor used by stream samplers in this forest.
     */
    public double getTimeDecay() {
        return timeDecay;
    }

    /**
     * @return true if points are saved with sequence indexes, false otherwise.
     */
    public boolean isStoreSequenceIndexesEnabled() {
        return storeSequenceIndexesEnabled;
    }

    /**
     * For compact forests, users can choose to specify the desired floating-point
     * precision to use internally to store points. Choosing single-precision will
     * reduce the memory size of the model at the cost of requiring double/float
     * conversions.
     *
     * @return the desired precision to use internally to store points.
     */
    public Precision getPrecision() {
        return Precision.FLOAT_32;
    }

    @Deprecated
    public boolean isCompact() {
        return true;
    }

    /**
     * @return true if internal shingling is performed, false otherwise.
     */
    public boolean isInternalShinglingEnabled() {
        return internalShinglingEnabled;
    }

    /**
     * @return true if tree nodes retain the center of mass, false otherwise.
     */
    public boolean isCenterOfMassEnabled() {
        return centerOfMassEnabled;
    }

    /**
     * @return true if parallel execution is enabled, false otherwise.
     */
    public boolean isParallelExecutionEnabled() {
        return parallelExecutionEnabled;
    }

    public double getBoundingBoxCacheFraction() {
        return boundingBoxCacheFraction;
    }

    /**
     * @return the number of threads in the thread pool if parallel execution is
     *         enabled, 0 otherwise.
     */
    public int getThreadPoolSize() {
        return threadPoolSize;
    }

    public IStateCoordinator<?, ?> getUpdateCoordinator() {
        return stateCoordinator;
    }

    public ComponentList<?, ?> getComponents() {
        return components;
    }

    /**
     * used for scoring and other function, expands to a shingled point in either
     * case performs a clean copy
     * 
     * @param point input point
     * @return a shingled copy or a clean copy
     */

    public float[] transformToShingledPoint(float[] point) {
        return stateCoordinator.getStore().transformToShingledPoint(point);
    }

    /**
     * does the pointstore use rotated shingles
     * 
     * @return true/false based on pointstore
     */
    public boolean isRotationEnabled() {
        return stateCoordinator.getStore().isInternalRotationEnabled();
    }

    /**
     * transforms the missing indices on the input point to the corresponding
     * indices of a shingled point
     * 
     * @param indexList input array of missing values
     * @param length    length of the input array
     * @return output array of missing values corresponding to shingle
     */
    protected int[] transformIndices(int[] indexList, int length) {
        return (internalShinglingEnabled && length == inputDimensions)
                ? stateCoordinator.getStore().transformIndices(indexList)
                : indexList;
    }

    /**
     *
     * @return the last known shingled point seen
     */
    public float[] lastShingledPoint() {
        checkArgument(internalShinglingEnabled, "incorrect use");
        return stateCoordinator.getStore().getInternalShingle();
    }

    /**
     *
     * @return the sequence index of the last known shingled point. If internal
     *         shingling is not enabled, then this would correspond to the number of
     *         updates
     */
    public long nextSequenceIndex() {
        return stateCoordinator.getStore().getNextSequenceIndex();
    }

    /**
     * Update the forest with the given point. The point is submitted to each
     * sampler in the forest. If the sampler accepts the point, the point is
     * submitted to the update method in the corresponding Random Cut Tree.
     *
     * @param point             The point used to update the forest.
     * @param updateShingleOnly only update the shingle (true for internal
     *                          shingling)
     */

    public void update(float[] point, boolean updateShingleOnly) {
        checkNotNull(point, "point must not be null");
        checkArgument(internalShinglingEnabled || point.length == dimensions,
                String.format("point.length must equal %d", dimensions));
        checkArgument(!internalShinglingEnabled || point.length == inputDimensions,
                String.format("point.length must equal %d for internal shingling", inputDimensions));
        checkArgument(!updateShingleOnly || internalShinglingEnabled,
                "update shingle setting is only valid for internal shingling");

        updateExecutor.update(point, updateShingleOnly);
    }

    @Deprecated
    public void update(double[] point) {
        update(toFloatArray(point), false);
    }

    public void update(float[] point) {
        update(point, false);
    }

    /**
     * Update the forest with the given point and a timestamp. The point is
     * submitted to each sampler in the forest as if that timestamp was the correct
     * stamp. storeSequenceIndexes must be false since the algorithm will not verify
     * the correctness of the timestamp.
     *
     * @param point       The point used to update the forest.
     * @param sequenceNum The timestamp of the corresponding point
     */
    public void update(double[] point, long sequenceNum) {
        checkNotNull(point, "point must not be null");
        update(toFloatArray(point), sequenceNum);
    }

    public void update(float[] point, long sequenceNum) {
        checkNotNull(point, "point must not be null");
        checkArgument(!internalShinglingEnabled, "cannot be applied with internal shingling");
        checkArgument(point.length == dimensions, () -> "point.length must equal to " + dimensions);
        updateExecutor.update(point, sequenceNum);
    }

    /**
     * Update the forest such that each tree caches a fraction of the bounding
     * boxes. This allows for a tradeoff between speed and storage.
     *
     * @param cacheFraction The (approximate) fraction of bounding boxes used in
     *                      caching.
     */
    public void setBoundingBoxCacheFraction(double cacheFraction) {
        checkArgument(0 <= cacheFraction, "cache cannot be negative");
        checkArgument(cacheFraction <= 1, "cacheFraction must be between 0 and 1 (inclusive)");
        updateExecutor.getComponents().forEach(c -> c.setConfig(Config.BOUNDING_BOX_CACHE_FRACTION, cacheFraction));
    }

    /**
     * changes the setting of time dependent sampling on the fly
     * 
     * @param timeDecay new value of sampling rate
     */
    public void setTimeDecay(double timeDecay) {
        checkArgument(0 <= timeDecay, "timeDecay must be greater than or equal to 0");
        this.timeDecay = timeDecay;
        updateExecutor.getComponents().forEach(c -> c.setConfig(Config.TIME_DECAY, timeDecay));
    }

    /**
     * Visit each of the trees in the forest and combine the individual results into
     * an aggregate result. A visitor is constructed for each tree using the visitor
     * factory, and then submitted to
     * {@link RandomCutTree#traverse(float[], IVisitorFactory)}. The results from
     * all the trees are combined using the accumulator and then transformed using
     * the finisher before being returned. Trees are visited in parallel using
     * {@link java.util.Collection#parallelStream()}.
     *
     * @param point          The point that defines the traversal path.
     * @param visitorFactory A factory method which is invoked for each tree to
     *                       construct a visitor.
     * @param accumulator    A function that combines the results from individual
     *                       trees into an aggregate result.
     * @param finisher       A function called on the aggregate result in order to
     *                       produce the final result.
     * @param <R>            The visitor result type. This is the type that will be
     *                       returned after traversing each individual tree.
     * @param <S>            The final type, after any final normalization at the
     *                       forest level.
     * @return The aggregated and finalized result after sending a visitor through
     *         each tree in the forest.
     */
    public <R, S> S traverseForest(float[] point, IVisitorFactory<R> visitorFactory, BinaryOperator<R> accumulator,
            Function<R, S> finisher) {

        checkNotNull(point, "point must not be null");
        checkArgument(point.length == dimensions, () -> "point.length must equal to " + dimensions);
        checkNotNull(visitorFactory, "visitorFactory must not be null");
        checkNotNull(accumulator, "accumulator must not be null");
        checkNotNull(finisher, "finisher must not be null");

        return traversalExecutor.traverseForest(point, visitorFactory, accumulator, finisher);
    }

    /**
     * Visit each of the trees in the forest and combine the individual results into
     * an aggregate result. A visitor is constructed for each tree using the visitor
     * factory, and then submitted to
     * {@link RandomCutTree#traverse(float[], IVisitorFactory)}. The results from
     * individual trees are collected using the {@link java.util.stream.Collector}
     * and returned. Trees are visited in parallel using
     * {@link java.util.Collection#parallelStream()}.
     *
     * @param point          The point that defines the traversal path.
     * @param visitorFactory A factory method which is invoked for each tree to
     *                       construct a visitor.
     * @param collector      A collector used to aggregate individual tree results
     *                       into a final result.
     * @param <R>            The visitor result type. This is the type that will be
     *                       returned after traversing each individual tree.
     * @param <S>            The final type, after any final normalization at the
     *                       forest level.
     * @return The aggregated and finalized result after sending a visitor through
     *         each tree in the forest.
     */
    public <R, S> S traverseForest(float[] point, IVisitorFactory<R> visitorFactory, Collector<R, ?, S> collector) {

        checkNotNull(point, "point must not be null");
        checkArgument(point.length == dimensions, () -> "point.length must equal to " + dimensions);
        checkNotNull(visitorFactory, "visitorFactory must not be null");
        checkNotNull(collector, "collector must not be null");

        return traversalExecutor.traverseForest(point, visitorFactory, collector);
    }

    /**
     * Visit each of the trees in the forest sequentially and combine the individual
     * results into an aggregate result. A visitor is constructed for each tree
     * using the visitor factory, and then submitted to
     * {@link RandomCutTree#traverse(float[], IVisitorFactory)}. The results from
     * all the trees are combined using the {@link ConvergingAccumulator}, and the
     * method stops visiting trees after convergence is reached. The result is
     * transformed using the finisher before being returned.
     *
     * @param point          The point that defines the traversal path.
     * @param visitorFactory A factory method which is invoked for each tree to
     *                       construct a visitor.
     * @param accumulator    An accumulator that combines the results from
     *                       individual trees into an aggregate result and checks to
     *                       see if the result can be returned without further
     *                       processing.
     * @param finisher       A function called on the aggregate result in order to
     *                       produce the final result.
     * @param <R>            The visitor result type. This is the type that will be
     *                       returned after traversing each individual tree.
     * @param <S>            The final type, after any final normalization at the
     *                       forest level.
     * @return The aggregated and finalized result after sending a visitor through
     *         each tree in the forest.
     */
    public <R, S> S traverseForest(float[] point, IVisitorFactory<R> visitorFactory,
            ConvergingAccumulator<R> accumulator, Function<R, S> finisher) {

        checkNotNull(point, "point must not be null");
        checkArgument(point.length == dimensions, () -> "point.length must equal to " + dimensions);
        checkNotNull(visitorFactory, "visitorFactory must not be null");
        checkNotNull(accumulator, "accumulator must not be null");
        checkNotNull(finisher, "finisher must not be null");

        return traversalExecutor.traverseForest(point, visitorFactory, accumulator, finisher);
    }

    /**
     * Visit each of the trees in the forest and combine the individual results into
     * an aggregate result. A multi-visitor is constructed for each tree using the
     * visitor factory, and then submitted to
     * {@link RandomCutTree#traverseMulti(float[], IMultiVisitorFactory)}. The
     * results from all the trees are combined using the accumulator and then
     * transformed using the finisher before being returned.
     *
     * @param point          The point that defines the traversal path.
     * @param visitorFactory A factory method which is invoked for each tree to
     *                       construct a multi-visitor.
     * @param accumulator    A function that combines the results from individual
     *                       trees into an aggregate result.
     * @param finisher       A function called on the aggregate result in order to
     *                       produce the final result.
     * @param <R>            The visitor result type. This is the type that will be
     *                       returned after traversing each individual tree.
     * @param <S>            The final type, after any final normalization at the
     *                       forest level.
     * @return The aggregated and finalized result after sending a visitor through
     *         each tree in the forest.
     */
    public <R, S> S traverseForestMulti(float[] point, IMultiVisitorFactory<R> visitorFactory,
            BinaryOperator<R> accumulator, Function<R, S> finisher) {

        checkNotNull(point, "point must not be null");
        checkArgument(point.length == dimensions, () -> "point.length must equal to " + dimensions);
        checkNotNull(visitorFactory, "visitorFactory must not be null");
        checkNotNull(accumulator, "accumulator must not be null");
        checkNotNull(finisher, "finisher must not be null");

        return traversalExecutor.traverseForestMulti(point, visitorFactory, accumulator, finisher);
    }

    /**
     * Visit each of the trees in the forest and combine the individual results into
     * an aggregate result. A multi-visitor is constructed for each tree using the
     * visitor factory, and then submitted to
     * {@link RandomCutTree#traverseMulti(float[], IMultiVisitorFactory)}. The
     * results from individual trees are collected using the
     * {@link java.util.stream.Collector} and returned. Trees are visited in
     * parallel using {@link java.util.Collection#parallelStream()}.
     *
     * @param point          The point that defines the traversal path.
     * @param visitorFactory A factory method which is invoked for each tree to
     *                       construct a visitor.
     * @param collector      A collector used to aggregate individual tree results
     *                       into a final result.
     * @param <R>            The visitor result type. This is the type that will be
     *                       returned after traversing each individual tree.
     * @param <S>            The final type, after any final normalization at the
     *                       forest level.
     * @return The aggregated and finalized result after sending a visitor through
     *         each tree in the forest.
     */
    public <R, S> S traverseForestMulti(float[] point, IMultiVisitorFactory<R> visitorFactory,
            Collector<R, ?, S> collector) {

        checkNotNull(point, "point must not be null");
        checkArgument(point.length == dimensions, () -> "point.length must equal to " + dimensions);
        checkNotNull(visitorFactory, "visitorFactory must not be null");
        checkNotNull(collector, "collector must not be null");

        return traversalExecutor.traverseForestMulti(point, visitorFactory, collector);
    }

    /**
     * Compute an anomaly score for the given point. The point being scored is
     * compared with the points in the sample to compute a measure of how anomalous
     * it is. Scores are greater than 0, with higher scores corresponding to bing
     * more anomalous. A threshold of 1.0 is commonly used to distinguish anomalous
     * points from non-anomalous ones.
     * <p>
     * See {@link AnomalyScoreVisitor} for more details about the anomaly score
     * algorithm.
     *
     * @param point The point being scored.
     * @return an anomaly score for the given point.
     */
    @Deprecated
    public double getAnomalyScore(double[] point) {
        return getAnomalyScore(toFloatArray(point));
    }

    public double getAnomalyScore(float[] point) {
        if (!isOutputReady()) {
            return 0.0;
        }

        IVisitorFactory<Double> visitorFactory = (tree, x) -> new AnomalyScoreVisitor(tree.projectToTree(x),
                tree.getMass());
        BinaryOperator<Double> accumulator = Double::sum;
        Function<Double, Double> finisher = x -> x / numberOfTrees;

        return traverseForest(transformToShingledPoint(point), visitorFactory, accumulator, finisher);
    }

    /**
     * Anomaly score evaluated sequentially with option of early stopping the early
     * stopping parameter precision gives an approximate solution in the range
     * (1-precision)*score(q)- precision, (1+precision)*score(q) + precision for the
     * score of a point q. In this function z is hardcoded to 0.1. If this function
     * is used, then not all the trees will be used in evaluation (but they have to
     * be updated anyways, because they may be used for the next q). The advantage
     * is that "almost certainly" anomalies/non-anomalies can be detected easily
     * with few trees.
     *
     * @param point input point q
     * @return anomaly score with early stopping with z=0.1
     */
    @Deprecated
    public double getApproximateAnomalyScore(double[] point) {
        return getApproximateAnomalyScore(toFloatArray(point));
    }

    public double getApproximateAnomalyScore(float[] point) {
        if (!isOutputReady()) {
            return 0.0;
        }

        IVisitorFactory<Double> visitorFactory = (tree, x) -> new AnomalyScoreVisitor(tree.projectToTree(x),
                tree.getMass());

        ConvergingAccumulator<Double> accumulator = new OneSidedConvergingDoubleAccumulator(
                DEFAULT_APPROXIMATE_ANOMALY_SCORE_HIGH_IS_CRITICAL, DEFAULT_APPROXIMATE_DYNAMIC_SCORE_PRECISION,
                DEFAULT_APPROXIMATE_DYNAMIC_SCORE_MIN_VALUES_ACCEPTED, numberOfTrees);

        Function<Double, Double> finisher = x -> x / accumulator.getValuesAccepted();

        return traverseForest(transformToShingledPoint(point), visitorFactory, accumulator, finisher);
    }

    /**
     * Compute an anomaly score attribution DiVector for the given point. The point
     * being scored is compared with the points in the sample to compute a measure
     * of how anomalous it is. The result DiVector will contain an anomaly score in
     * both the positive and negative directions for each dimension of the data.
     * <p>
     * See {@link AnomalyAttributionVisitor} for more details about the anomaly
     * score algorithm.
     *
     * @param point The point being scored.
     * @return an anomaly score for the given point.
     */
    public DiVector getAnomalyAttribution(double[] point) {
        return getAnomalyAttribution(toFloatArray(point));
    }

    public DiVector getAnomalyAttribution(float[] point) {
        // this will return the same (modulo floating point summation) L1Norm as
        // getAnomalyScore
        if (!isOutputReady()) {
            return new DiVector(dimensions);
        }

        IVisitorFactory<DiVector> visitorFactory = new VisitorFactory<>(
                (tree, y) -> new AnomalyAttributionVisitor(tree.projectToTree(y), tree.getMass()),
                (tree, x) -> x.lift(tree::liftFromTree));
        BinaryOperator<DiVector> accumulator = DiVector::addToLeft;
        Function<DiVector, DiVector> finisher = x -> x.scale(1.0 / numberOfTrees);

        return traverseForest(transformToShingledPoint(point), visitorFactory, accumulator, finisher);
    }

    /**
     * Sequential version of attribution corresponding to getAnomalyScoreSequential;
     * The high-low sum in the result should be the same as the scalar score
     * computed by {@link #getAnomalyScore(double[])}.
     *
     * @param point The point being scored.
     * @return anomaly attribution for the given point.
     */
    public DiVector getApproximateAnomalyAttribution(double[] point) {
        return getApproximateAnomalyAttribution(toFloatArray(point));
    }

    public DiVector getApproximateAnomalyAttribution(float[] point) {
        if (!isOutputReady()) {
            return new DiVector(dimensions);
        }

        IVisitorFactory<DiVector> visitorFactory = new VisitorFactory<>(
                (tree, y) -> new AnomalyAttributionVisitor(tree.projectToTree(y), tree.getMass()),
                (tree, x) -> x.lift(tree::liftFromTree));

        ConvergingAccumulator<DiVector> accumulator = new OneSidedConvergingDiVectorAccumulator(dimensions,
                DEFAULT_APPROXIMATE_ANOMALY_SCORE_HIGH_IS_CRITICAL, DEFAULT_APPROXIMATE_DYNAMIC_SCORE_PRECISION,
                DEFAULT_APPROXIMATE_DYNAMIC_SCORE_MIN_VALUES_ACCEPTED, numberOfTrees);

        Function<DiVector, DiVector> finisher = x -> x.scale(1.0 / accumulator.getValuesAccepted());

        return traverseForest(transformToShingledPoint(point), visitorFactory, accumulator, finisher);
    }

    /**
     * Compute a density estimate at the given point.
     * <p>
     * See {@link SimpleInterpolationVisitor} and {@link DensityOutput} for more
     * details about the density computation.
     *
     * @param point The point where the density estimate is made.
     * @return A density estimate.
     */
    @Deprecated
    public DensityOutput getSimpleDensity(double[] point) {
        return getSimpleDensity(toFloatArray(point));
    }

    public DensityOutput getSimpleDensity(float[] point) {

        // density estimation should use sufficiently larger number of samples
        // and only return answers when full

        if (!isOutputReady()) {
            return new DensityOutput(dimensions, sampleSize);
        }

        IVisitorFactory<InterpolationMeasure> visitorFactory = new VisitorFactory<>((tree,
                y) -> new SimpleInterpolationVisitor(tree.projectToTree(y), tree.getMass(), 1.0, centerOfMassEnabled),
                (tree, x) -> x.lift(tree::liftFromTree));
        Collector<InterpolationMeasure, ?, InterpolationMeasure> collector = InterpolationMeasure.collector(dimensions,
                0, numberOfTrees);
        DensityOutput a = new DensityOutput(traverseForest(transformToShingledPoint(point), visitorFactory, collector));
        return new DensityOutput(traverseForest(transformToShingledPoint(point), visitorFactory, collector));
    }

    /**
     * Given a point with missing values, return a collection of treesamples. These
     * tree samples can be postprocessed in a variety of ways -- primarily to
     * produce summaries and imputation. The treesamples correspond to pointstore
     * index, distances to tree points (excluding the missing values) the actual
     * point at the leaf and the tree sample is 1 for each tree.
     *
     *
     * @param point          A point with missing values.
     * @param missingIndexes An array containing the indexes of the missing values
     *                       in the point. The length of the array should be greater
     *                       than or equal to the number of missing values.
     * @param centrality     a parameter that provides a central estimation versus a
     *                       more random estimation
     * @return A collection of tree samples
     */
    protected List<ConditionalTreeSample> getConditionalField(float[] point, int[] missingIndexes, double centrality) {

        // missing indexes can be null -- but then getNearNeighborsInSample may be more
        // efficient
        checkArgument(centrality >= 0, " cannot be negative");
        checkArgument(centrality <= 1, "centrality needs to be in range [0,1]");
        checkArgument(point != null, " cannot be null");
        if (!isOutputReady()) {
            return new ArrayList<>();
        }

        int[] liftedIndices = transformIndices(missingIndexes, point.length);
        IMultiVisitorFactory<ConditionalTreeSample> visitorFactory = (tree, y) -> new ImputeVisitor(y,
                tree.projectToTree(y), liftedIndices, tree.projectMissingIndices(liftedIndices), centrality,
                tree.getRandomSeed());
        return traverseForestMulti(transformToShingledPoint(point), visitorFactory, ConditionalTreeSample.collector);
    }

    /**
     * The function returns summary statistics of points close to a query point
     * (with possible missing values). The statics can perform an optional
     * multicentroid clustering
     * 
     * @param point                   the query point
     * @param missingIndexes          the list of positions which are missing
     * @param numberOfRepresentatives number of representatives in a cluster
     * @param shrinkage               controls the shape of clusters (=0 corresponds
     *                                to spanning trees, and =1 corresponds to
     *                                centroidal clustering)
     * @param addtypical              an option to perform the clustering/not
     * @param project                 should the clustring/statistics be computed
     *                                only on the data projected to the entries in
     *                                missingIndexes
     * @param centrality              how closely should each tree try to predict
     *                                the missing values =0 implies loosely, =1
     *                                implies closely
     * @param shingleSize             the effective shingleSize -- the
     *                                clustering/statistics would be projected to
     *                                the last dimension/shinglesize values
     * @return a summary of the predictions returned by each tree
     */
    public SampleSummary getConditionalFieldSummary(float[] point, int[] missingIndexes, int numberOfRepresentatives,
            double shrinkage, boolean addtypical, boolean project, double centrality, int shingleSize) {
        // missing indexes can be null -- but then getNearNeighborsInSample may be more
        // efficient
        checkArgument(centrality >= 0, " cannot be negative");
        checkArgument(centrality <= 1, "centrality needs to be in range [0,1]");
        checkArgument(point != null, " cannot be null");
        if (!isOutputReady()) {
            return new SampleSummary(dimensions);
        }

        int[] liftedIndices = transformIndices(missingIndexes, point.length);
        ConditionalSampleSummarizer summarizer = new ConditionalSampleSummarizer(liftedIndices,
                transformToShingledPoint(point), centrality, project, numberOfRepresentatives, shrinkage, shingleSize);
        return summarizer.summarize(getConditionalField(point, missingIndexes, centrality), addtypical);
    }

    /**
     * Given a point with missing values, return a new point with the missing values
     * imputed. Each tree in the forest individual produces an imputed value. The
     * median imputed value is returned. This can be improved using
     * getConditionalSummary or getConditionalField
     *
     * @param point          A point with missing values.
     * @param missingIndexes An array containing the indexes of the missing values
     *                       in the point. The length of the array should be greater
     *                       than or equal to the number of missing values.
     * @return A point with the missing values imputed.
     */

    public float[] imputeMissingValues(float[] point, int[] missingIndexes) {
        return getConditionalFieldSummary(point, missingIndexes, 1, 0, false, false, 1.0, 1).median;
    }

    // number of missing values is redundant
    @Deprecated
    public float[] imputeMissingValues(float[] point, int numberOfMissingValues, int[] missingIndexes) {
        return imputeMissingValues(point, missingIndexes);
    }

    @Deprecated
    public double[] imputeMissingValues(double[] point, int numberOfMissingValues, int[] missingIndexes) {
        return toDoubleArray(imputeMissingValues(toFloatArray(point), numberOfMissingValues, missingIndexes));
    }

    /**
     * Given an initial shingled point, extrapolate the stream into the future to
     * produce a forecast. This method is intended to be called when the input data
     * is being shingled, and it works by imputing forward one shingle block at a
     * time.
     *
     * @param point        The starting point for extrapolation.
     * @param horizon      The number of blocks to forecast.
     * @param blockSize    The number of entries in a block. This should be the same
     *                     as the size of a single input to the shingle.
     * @param cyclic       If true then the shingling is cyclic, otherwise it's a
     *                     sliding shingle.
     * @param shingleIndex If cyclic is true, then this should be the current index
     *                     in the shingle. That is, the index where the next point
     *                     added to the shingle would be written. If cyclic is false
     *                     then this value is not used.
     * @return a forecasted time series.
     */
    @Deprecated
    double[] extrapolateBasic(double[] point, int horizon, int blockSize, boolean cyclic, int shingleIndex) {
        return toDoubleArray(extrapolateBasic(toFloatArray(point), horizon, blockSize, cyclic, shingleIndex));
    }

    @Deprecated
    float[] extrapolateBasic(float[] point, int horizon, int blockSize, boolean cyclic, int shingleIndex) {
        return extrapolateWithRanges(point, horizon, blockSize, cyclic, shingleIndex, 1.0).values;
    }

    // the following is provided for maximum flexibilty from the calling entity;
    // but likely use is extrapolateFromShingle(), which abstracts away rotation
    // etc.
    public RangeVector extrapolateWithRanges(float[] point, int horizon, int blockSize, boolean cyclic,
            int shingleIndex, double centrality) {
        checkArgument(0 < blockSize && blockSize < dimensions,
                "blockSize must be between 0 and dimensions (exclusive)");
        checkArgument(dimensions % blockSize == 0, "dimensions must be evenly divisible by blockSize");
        checkArgument(0 <= shingleIndex && shingleIndex < dimensions / blockSize,
                "shingleIndex must be between 0 (inclusive) and dimensions / blockSize");

        RangeVector result = new RangeVector(blockSize * horizon);
        int[] missingIndexes = new int[blockSize];
        float[] queryPoint = Arrays.copyOf(point, dimensions);

        if (cyclic) {
            extrapolateBasicCyclic(result, horizon, blockSize, shingleIndex, queryPoint, missingIndexes, centrality);
        } else {
            extrapolateBasicSliding(result, horizon, blockSize, queryPoint, missingIndexes, centrality);
        }

        return result;
    }

    // external management of shingle; can function for both internal and external
    // shingling
    // however blocksize has to be externally managed

    @Deprecated
    RangeVector extrapolateFromShingle(float[] shingle, int horizon, int blockSize, double centrality) {
        return extrapolateWithRanges(shingle, horizon, blockSize, isRotationEnabled(),
                ((int) nextSequenceIndex()) % shingleSize, centrality);
    }

    /**
     * Given an initial shingled point, extrapolate the stream into the future to
     * produce a forecast. This method is intended to be called when the input data
     * is being shingled, and it works by imputing forward one shingle block at a
     * time. If the shingle is cyclic, then this method uses 0 as the shingle index.
     *
     * @param point     The starting point for extrapolation.
     * @param horizon   The number of blocks to forecast.
     * @param blockSize The number of entries in a block. This should be the same as
     *                  the size of a single input to the shingle.
     * @param cyclic    If true then the shingling is cyclic, otherwise it's a
     *                  sliding shingle.
     * @return a forecasted time series.
     */
    @Deprecated
    double[] extrapolateBasic(double[] point, int horizon, int blockSize, boolean cyclic) {
        return toDoubleArray(extrapolateBasic(toFloatArray(point), horizon, blockSize, cyclic, 0));
    }

    protected float[] extrapolateBasic(float[] point, int horizon, int blockSize, boolean cyclic) {
        return extrapolateBasic(point, horizon, blockSize, cyclic, 0);
    }

    /**
     * Given a shingle builder, extrapolate the stream into the future to produce a
     * forecast. This method assumes you are passing in the shingle builder used to
     * preprocess points before adding them to this forest.
     *
     * @param builder The shingle builder used to process points before adding them
     *                to the forest.
     * @param horizon The number of blocks to forecast.
     * @return a forecasted time series.
     */
    @Deprecated
    public double[] extrapolateBasic(ShingleBuilder builder, int horizon) {
        return toDoubleArray(extrapolateBasic(toFloatArray(builder.getShingle()), horizon, builder.getInputPointSize(),
                builder.isCyclic(), builder.getShingleIndex()));
    }

    void extrapolateBasicSliding(RangeVector result, int horizon, int blockSize, float[] queryPoint,
            int[] missingIndexes, double centrality) {
        int resultIndex = 0;

        Arrays.fill(missingIndexes, 0);
        for (int y = 0; y < blockSize; y++) {
            missingIndexes[y] = dimensions - blockSize + y;
        }

        for (int k = 0; k < horizon; k++) {
            // shift all entries in the query point left by 1 block
            System.arraycopy(queryPoint, blockSize, queryPoint, 0, dimensions - blockSize);

            SampleSummary imputedSummary = getConditionalFieldSummary(queryPoint, missingIndexes, 1, 0, false, false,
                    centrality, dimensions / blockSize);
            for (int y = 0; y < blockSize; y++) {
                result.values[resultIndex] = queryPoint[dimensions - blockSize + y] = imputedSummary.median[y];
                result.lower[resultIndex] = imputedSummary.lower[y];
                result.upper[resultIndex] = imputedSummary.upper[y];
                resultIndex++;
            }
        }
    }

    void extrapolateBasicCyclic(RangeVector result, int horizon, int blockSize, int shingleIndex, float[] queryPoint,
            int[] missingIndexes, double centrality) {

        int resultIndex = 0;
        int currentPosition = shingleIndex;
        Arrays.fill(missingIndexes, 0);

        for (int k = 0; k < horizon; k++) {
            for (int y = 0; y < blockSize; y++) {
                missingIndexes[y] = (currentPosition + y) % dimensions;
            }

            SampleSummary imputedSummary = getConditionalFieldSummary(queryPoint, missingIndexes, 1, 0, false, false,
                    centrality, 1);

            for (int y = 0; y < blockSize; y++) {
                result.values[resultIndex] = queryPoint[(currentPosition + y)
                        % dimensions] = imputedSummary.median[(currentPosition + y) % dimensions];
                result.lower[resultIndex] = imputedSummary.lower[(currentPosition + y) % dimensions];
                result.upper[resultIndex] = imputedSummary.upper[(currentPosition + y) % dimensions];
                resultIndex++;
            }

            currentPosition = (currentPosition + blockSize) % dimensions;
        }
    }

    /**
     * Extrapolate the stream into the future to produce a forecast. This method is
     * intended to be called when the input data is being shingled internally, and
     * it works by imputing forward one shingle block at a time.
     *
     * @param horizon The number of blocks to forecast.
     * @return a forecasted time series.
     */
    public double[] extrapolate(int horizon) {
        return toDoubleArray(extrapolateFromCurrentTime(horizon));
    }

    public float[] extrapolateFromCurrentTime(int horizon) {
        checkArgument(internalShinglingEnabled, "incorrect use");
        IPointStore<?, ?> store = stateCoordinator.getStore();
        return extrapolateBasic(lastShingledPoint(), horizon, inputDimensions, store.isInternalRotationEnabled(),
                ((int) nextSequenceIndex()) % shingleSize);
    }

    /**
     * For each tree in the forest, follow the tree traversal path and return the
     * leaf node if the standard Euclidean distance between the query point and the
     * leaf point is smaller than the given threshold. Note that this will not
     * necessarily be the nearest point in the tree, because the traversal path is
     * determined by the random cuts in the tree. If the same leaf point is found in
     * multiple trees, those results will be combined into a single Neighbor in the
     * result.
     *
     * If sequence indexes are disabled for this forest, then the list of sequence
     * indexes will be empty in returned Neighbors.
     *
     * @param point             A point whose neighbors we want to find.
     * @param distanceThreshold The maximum Euclidean distance for a point to be
     *                          considered a neighbor.
     * @return a list of Neighbors, ordered from closest to furthest.
     */
    @Deprecated
    public List<Neighbor> getNearNeighborsInSample(double[] point, double distanceThreshold) {
        return getNearNeighborsInSample(toFloatArray(point), distanceThreshold);
    }

    public List<Neighbor> getNearNeighborsInSample(float[] point, double distanceThreshold) {
        checkNotNull(point, "point must not be null");
        checkArgument(distanceThreshold > 0, "distanceThreshold must be greater than 0");

        if (!isOutputReady()) {
            return Collections.emptyList();
        }

        IVisitorFactory<Optional<Neighbor>> visitorFactory = (tree, x) -> new NearNeighborVisitor(x, distanceThreshold);

        return traverseForest(transformToShingledPoint(point), visitorFactory, Neighbor.collector());
    }

    /**
     * For each tree in the forest, follow the tree traversal path and return the
     * leaf node. Note that this will not necessarily be the nearest point in the
     * tree, because the traversal path is determined by the random cuts in the
     * tree. If the same leaf point is found in multiple trees, those results will
     * be combined into a single Neighbor in the result.
     *
     * If sequence indexes are disabled for this forest, then sequenceIndexes will
     * be empty in the returned Neighbors.
     *
     * @param point A point whose neighbors we want to find.
     * @return a list of Neighbors, ordered from closest to furthest.
     */
    @Deprecated
    public List<Neighbor> getNearNeighborsInSample(double[] point) {
        return getNearNeighborsInSample(toFloatArray(point));
    }

    public List<Neighbor> getNearNeighborsInSample(float[] point) {
        return getNearNeighborsInSample(point, Double.POSITIVE_INFINITY);
    }

    /**
     * @return true if all samplers are ready to output results.
     */
    public boolean isOutputReady() {
        return outputReady || (outputReady = stateCoordinator.getTotalUpdates() >= outputAfter
                && components.stream().allMatch(IComponentModel::isOutputReady));
    }

    /**
     * @return true if all samplers in the forest are full.
     */
    public boolean samplersFull() {
        return stateCoordinator.getTotalUpdates() >= sampleSize;
    }

    /**
     * Returns the total number updates to the forest.
     *
     * The count of updates is represented with long type and may overflow.
     *
     * @return the total number of updates to the forest.
     */
    public long getTotalUpdates() {
        return stateCoordinator.getTotalUpdates();
    }

    public void pauseSampling() {
        updateExecutor.setCurrentlySampling(false);
    }

    public void resumeSampling() {
        updateExecutor.setCurrentlySampling(true);
    }

    public boolean isCurrentlySampling() {
        return updateExecutor.isCurrentlySampling();
    }

    /**
     * an L1 clustering primitive that shows the aggregation of the points stored in
     * RCF the clustering uses multi-centroid clustering introduced in CURE
     * https://en.wikipedia.org/wiki/CURE_algorithm However CURE also shrunk the
     * well scattered points by a fraction alpha (there by creating new points);
     * while that concept is used herein, the (multi) summarization algorithm
     * changes the distance metric as opposed to creating new points since
     * continuity of values is not an useful assumption in context of RCFs. The
     * usage of distance metric is similar to the discussion in
     * https://en.wikipedia.org/wiki/Data_stream_clustering See the examples package
     * for an example of dynamic summarization. /
     * 
     * @param maxAllowed              maximum number of clusters one is willing to
     *                                see
     * @param shrinkage               a parameter that controls between spherical
     *                                nature (=1) and MST (=0), this corresponds to
     *                                the parameter alpha in the description above
     * @param numberOfRepresentatives number of centroids used to represent a
     *                                cluster, this is the parameter c in the
     *                                description of CURE
     * @param separationRatio         a parameter in [0,1] that controls how
     *                                zealously should the algorithm reduce the
     *                                number of clusters a default value of 0.8 is a
     *                                reasonable value for many settings. A value
     *                                close to 0 would tend to merge eveything into
     *                                a single cluster. The option is provided since
     *                                it can be of use in the future to produce
     *                                dendograms and similar information.
     * @param distance                a distance function for points
     * @param previous                a (possibly null) list of previous clustering
     *                                obtained. If the list is non-null then the
     *                                representatives of the previous cluster would
     *                                be added as zero weight points, ensuring that
     *                                the summarization is more smooth (in contrast
     *                                to two independent summarizations). The zero
     *                                weight points of the past can serve as
     *                                representatives of the current clustering.
     * @return a list of clusters
     */
    public List<ICluster<float[]>> summarize(int maxAllowed, double shrinkage, int numberOfRepresentatives,
            double separationRatio, BiFunction<float[], float[], Double> distance, List<ICluster<float[]>> previous) {
        return stateCoordinator.getStore().summarize(maxAllowed, shrinkage, numberOfRepresentatives, separationRatio,
                distance, previous);
    }

    // same as above with default filled in
    public List<ICluster<float[]>> summarize(int maxAllowed, double shrinkage, int numberOfRepresentatives,
            List<ICluster<float[]>> previous) {
        return summarize(maxAllowed, shrinkage, numberOfRepresentatives, DEFAULT_SEPARATION_RATIO_FOR_MERGE,
                Summarizer::L1distance, previous);
    }

    public static class Builder<T extends Builder<T>> {

        // We use Optional types for optional primitive fields when it doesn't make
        // sense to use a constant default.

        private int dimensions;
        private int sampleSize = DEFAULT_SAMPLE_SIZE;
        private Optional<Integer> outputAfter = Optional.empty();
        private int numberOfTrees = DEFAULT_NUMBER_OF_TREES;
        private Optional<Double> timeDecay = Optional.empty();
        private Optional<Long> randomSeed = Optional.empty();
        private boolean storeSequenceIndexesEnabled = DEFAULT_STORE_SEQUENCE_INDEXES_ENABLED;
        private boolean centerOfMassEnabled = DEFAULT_CENTER_OF_MASS_ENABLED;
        private boolean parallelExecutionEnabled = DEFAULT_PARALLEL_EXECUTION_ENABLED;
        private Optional<Integer> threadPoolSize = Optional.empty();
        private boolean directLocationMapEnabled = DEFAULT_DIRECT_LOCATION_MAP;
        private double boundingBoxCacheFraction = DEFAULT_BOUNDING_BOX_CACHE_FRACTION;
        private int shingleSize = DEFAULT_SHINGLE_SIZE;

        private boolean internalShinglingEnabled = DEFAULT_INTERNAL_SHINGLING_ENABLED;
        protected boolean internalRotationEnabled = DEFAULT_INTERNAL_ROTATION_ENABLED;
        protected Optional<Integer> initialPointStoreSize = Optional.empty();
        protected double initialAcceptFraction = DEFAULT_INITIAL_ACCEPT_FRACTION;

        public T dimensions(int dimensions) {
            this.dimensions = dimensions;
            return (T) this;
        }

        public T sampleSize(int sampleSize) {
            this.sampleSize = sampleSize;
            return (T) this;
        }

        public T outputAfter(int outputAfter) {
            this.outputAfter = Optional.of(outputAfter);
            return (T) this;
        }

        public T numberOfTrees(int numberOfTrees) {
            this.numberOfTrees = numberOfTrees;
            return (T) this;
        }

        public T shingleSize(int shingleSize) {
            this.shingleSize = shingleSize;
            return (T) this;
        }

        public T timeDecay(double timeDecay) {
            this.timeDecay = Optional.of(timeDecay);
            return (T) this;
        }

        public T randomSeed(long randomSeed) {
            this.randomSeed = Optional.of(randomSeed);
            return (T) this;
        }

        public T centerOfMassEnabled(boolean centerOfMassEnabled) {
            this.centerOfMassEnabled = centerOfMassEnabled;
            return (T) this;
        }

        public T parallelExecutionEnabled(boolean parallelExecutionEnabled) {
            this.parallelExecutionEnabled = parallelExecutionEnabled;
            return (T) this;
        }

        public T threadPoolSize(int threadPoolSize) {
            this.threadPoolSize = Optional.of(threadPoolSize);
            return (T) this;
        }

        public T initialPointStoreSize(int initialPointStoreSize) {
            this.initialPointStoreSize = Optional.of(initialPointStoreSize);
            return (T) this;
        }

        public T storeSequenceIndexesEnabled(boolean storeSequenceIndexesEnabled) {
            this.storeSequenceIndexesEnabled = storeSequenceIndexesEnabled;
            return (T) this;
        }

        @Deprecated
        public T compact(boolean compact) {
            return (T) this;
        }

        public T internalShinglingEnabled(boolean internalShinglingEnabled) {
            this.internalShinglingEnabled = internalShinglingEnabled;
            return (T) this;
        }

        public T internalRotationEnabled(boolean internalRotationEnabled) {
            this.internalRotationEnabled = internalRotationEnabled;
            return (T) this;
        }

        @Deprecated
        public T dynamicResizingEnabled(boolean dynamicResizingEnabled) {
            return (T) this;
        }

        @Deprecated
        public T precision(Precision precision) {
            return (T) this;
        }

        public T boundingBoxCacheFraction(double boundingBoxCacheFraction) {
            this.boundingBoxCacheFraction = boundingBoxCacheFraction;
            return (T) this;
        }

        public T initialAcceptFraction(double initialAcceptFraction) {
            this.initialAcceptFraction = initialAcceptFraction;
            return (T) this;
        }

        public RandomCutForest build() {
            return new RandomCutForest(this);
        }

        public Random getRandom() {
            // If a random seed was given, use it to create a new Random. Otherwise, call
            // the 0-argument constructor
            return randomSeed.map(Random::new).orElseGet(Random::new);
        }
    }

    /**
     * Score a point using the given scoring functions.
     *
     * @param point                   input point being scored
     * @param ignoreLeafMassThreshold said threshold
     * @param seen                    the function that applies if input is equal to
     *                                a previously seen sample in a leaf
     * @param unseen                  if the input does not have a match in the
     *                                leaves
     * @param damp                    damping function based on the duplicity of the
     *                                previously seen samples
     * @return anomaly score
     */
    public double getDynamicScore(float[] point, int ignoreLeafMassThreshold, BiFunction<Double, Double, Double> seen,
            BiFunction<Double, Double, Double> unseen, BiFunction<Double, Double, Double> damp) {

        checkArgument(ignoreLeafMassThreshold >= 0, "ignoreLeafMassThreshold should be greater than or equal to 0");

        if (!isOutputReady()) {
            return 0.0;
        }

        VisitorFactory<Double> visitorFactory = new VisitorFactory<>((tree, y) -> new DynamicScoreVisitor(
                tree.projectToTree(y), tree.getMass(), ignoreLeafMassThreshold, seen, unseen, damp));
        BinaryOperator<Double> accumulator = Double::sum;

        Function<Double, Double> finisher = sum -> sum / numberOfTrees;

        return traverseForest(transformToShingledPoint(point), visitorFactory, accumulator, finisher);
    }

    /**
     * Similar to above but now the scoring takes in a function of Bounding Box to
     * probabilities (vector over the dimensions); and produces a score af-if the
     * tree were built using that function (when in reality the tree is an RCF).
     * Changing the defaultRCFgVec function to some other function f() will provide
     * a mechanism of dynamic scoring for trees that are built using f() which is
     * the purpose of TransductiveScalarScore visitor. Note that the answer is an
     * MCMC simulation and is not normalized (because the scoring functions are
     * flexible and unknown) and over a small number of trees the errors can be
     * large specially if vecSep is very far from defaultRCFgVec
     *
     * Given the large number of possible sources of distortion, ignoreLeafThreshold
     * is not supported.
     *
     * @param point  point to be scored
     * @param seen   the score function for seen point
     * @param unseen score function for unseen points
     * @param damp   dampening the score for duplicates
     * @param vecSep the function of (BoundingBox) -&gt; array of probabilities
     * @return the simuated score
     */

    public double getDynamicSimulatedScore(float[] point, BiFunction<Double, Double, Double> seen,
            BiFunction<Double, Double, Double> unseen, BiFunction<Double, Double, Double> damp,
            Function<IBoundingBoxView, double[]> vecSep) {

        if (!isOutputReady()) {
            return 0.0;
        }

        VisitorFactory<Double> visitorFactory = new VisitorFactory<>(
                (tree, y) -> new SimulatedTransductiveScalarScoreVisitor(tree.projectToTree(y), tree.getMass(), seen,
                        unseen, damp, CommonUtils::defaultRCFgVecFunction, vecSep));
        BinaryOperator<Double> accumulator = Double::sum;

        Function<Double, Double> finisher = sum -> sum / numberOfTrees;

        return traverseForest(transformToShingledPoint(point), visitorFactory, accumulator, finisher);
    }

    /**
     * Score a point using the given scoring functions. This method will
     * short-circuit before visiting all trees if the scores that are returned from
     * a subset of trees appears to be converging to a given value. See
     * {@link OneSidedConvergingDoubleAccumulator} for more about convergence.
     *
     * @param point                   input point
     * @param precision               controls early convergence
     * @param highIsCritical          this is true for the default scoring function.
     *                                If the user wishes to use a different scoring
     *                                function where anomaly scores are low values
     *                                (for example, height in tree) then this should
     *                                be set to false.
     * @param ignoreLeafMassThreshold said threshold
     * @param seen                    scoring function when the input matches some
     *                                tuple in the leaves
     * @param unseen                  scoring function when the input is not found
     * @param damp                    dampening function for duplicates which are
     *                                same as input (applies with seen)
     * @return the dynamic score under sequential early stopping
     */
    public double getApproximateDynamicScore(float[] point, double precision, boolean highIsCritical,
            int ignoreLeafMassThreshold, BiFunction<Double, Double, Double> seen,
            BiFunction<Double, Double, Double> unseen, BiFunction<Double, Double, Double> damp) {

        checkArgument(ignoreLeafMassThreshold >= 0, "ignoreLeafMassThreshold should be greater than or equal to 0");

        if (!isOutputReady()) {
            return 0.0;
        }

        VisitorFactory<Double> visitorFactory = new VisitorFactory<>((tree, y) -> new DynamicScoreVisitor(
                tree.projectToTree(y), tree.getMass(), ignoreLeafMassThreshold, seen, unseen, damp));

        ConvergingAccumulator<Double> accumulator = new OneSidedConvergingDoubleAccumulator(highIsCritical, precision,
                DEFAULT_APPROXIMATE_DYNAMIC_SCORE_MIN_VALUES_ACCEPTED, numberOfTrees);

        Function<Double, Double> finisher = x -> x / accumulator.getValuesAccepted();

        return traverseForest(transformToShingledPoint(point), visitorFactory, accumulator, finisher);
    }

    /**
     * Same as above, but for dynamic scoring. See the params of
     * getDynamicScoreParallel
     *
     * @param point                   point to be scored
     * @param ignoreLeafMassThreshold said threshold
     * @param seen                    score function for seen points
     * @param unseen                  score function for unseen points
     * @param newDamp                 dampening function for duplicates in the seen
     *                                function
     * @return dynamic scoring attribution DiVector
     */
    public DiVector getDynamicAttribution(float[] point, int ignoreLeafMassThreshold,
            BiFunction<Double, Double, Double> seen, BiFunction<Double, Double, Double> unseen,
            BiFunction<Double, Double, Double> newDamp) {

        if (!isOutputReady()) {
            return new DiVector(dimensions);
        }

        VisitorFactory<DiVector> visitorFactory = new VisitorFactory<>(
                (tree, y) -> new DynamicAttributionVisitor(tree.projectToTree(y), tree.getMass(),
                        ignoreLeafMassThreshold, seen, unseen, newDamp),
                (tree, x) -> x.lift(tree::liftFromTree));
        BinaryOperator<DiVector> accumulator = DiVector::addToLeft;
        Function<DiVector, DiVector> finisher = x -> x.scale(1.0 / numberOfTrees);

        return traverseForest(transformToShingledPoint(point), visitorFactory, accumulator, finisher);
    }

    /**
     * Atrribution for dynamic sequential scoring; getL1Norm() should agree with
     * getDynamicScoringSequential
     *
     * @param point                   input
     * @param precision               parameter to stop early stopping
     * @param highIsCritical          are high values anomalous (otherwise low
     *                                values are anomalous)
     * @param ignoreLeafMassThreshold we ignore leaves with mass equal/below *
     *                                threshold
     * @param seen                    function for scoring points that have been
     *                                seen before
     * @param unseen                  function for scoring points not seen in tree
     * @param newDamp                 dampening function based on duplicates
     * @return attribution DiVector of the score
     */
    public DiVector getApproximateDynamicAttribution(float[] point, double precision, boolean highIsCritical,
            int ignoreLeafMassThreshold, BiFunction<Double, Double, Double> seen,
            BiFunction<Double, Double, Double> unseen, BiFunction<Double, Double, Double> newDamp) {

        if (!isOutputReady()) {
            return new DiVector(dimensions);
        }

        VisitorFactory<DiVector> visitorFactory = new VisitorFactory<>((tree, y) -> new DynamicAttributionVisitor(y,
                tree.getMass(), ignoreLeafMassThreshold, seen, unseen, newDamp),
                (tree, x) -> x.lift(tree::liftFromTree));

        ConvergingAccumulator<DiVector> accumulator = new OneSidedConvergingDiVectorAccumulator(dimensions,
                highIsCritical, precision, DEFAULT_APPROXIMATE_DYNAMIC_SCORE_MIN_VALUES_ACCEPTED, numberOfTrees);

        Function<DiVector, DiVector> finisher = vector -> vector.scale(1.0 / accumulator.getValuesAccepted());

        return traverseForest(transformToShingledPoint(point), visitorFactory, accumulator, finisher);
    }

}


================================================
FILE: Java/core/src/main/java/com/amazon/randomcutforest/Visitor.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import com.amazon.randomcutforest.tree.INodeView;

/**
 * This is the interface for a visitor which can be used to query a ITraversable
 * to produce a result. A visitor is submitted to
 * ITraversable#traverse(double[], Visitor), and during the traversal the
 * {@link #acceptLeaf} and {@link #accept} methods are invoked on the nodes in
 * the traversal path.
 * <p>
 * See ITraversable#traverse(double[], Visitor) for details about the traversal
 * path.
 */
public interface Visitor<R> {
    /**
     * Visit a node in the traversal path.
     *
     * @param node        the node being visited
     * @param depthOfNode the depth of the node being visited
     */
    void accept(INodeView node, int depthOfNode);

    /**
     * Visit the leaf node in the traversal path. By default, this method proxies to
     * {@link #accept(INodeView, int)}.
     *
     * @param leafNode    the leaf node being visited
     * @param depthOfNode the depth of the leaf node
     */
    default void acceptLeaf(INodeView leafNode, final int depthOfNode) {
        accept(leafNode, depthOfNode);
    }

    /**
     * At the end of the traversal, this method is called to obtain the result
     * computed by the visitor.
     *
     * @return the result value computed by the visitor.
     */
    R getResult();

    /**
     * This method short-circuits the evaluation of the Visitor at nodes on the
     * traversal path. By default, the accept (or acceptLeaf) method will be invoked
     * for each Node in the traversal path. But the NodeView has to prepare
     * information to support that visitor invocation. Before invocation, the value
     * of isConverged will be checked. If it is true, some of that preparation can
     * be skipped -- because the visitor would not be updated. This method can be
     * overwritten to optimize visitors that do not need to visit every node on the
     * root to leaf path before returning a value.
     *
     * Mote that this convergence applies to a single visitor computation and is
     * expected to be a speedup without any change in the value of the answer. This
     * is different from converging accumulator which corresponds to sequential
     * evaluation of different visitors and early stopping.
     **/
    default boolean isConverged() {
        return false;
    }
}


================================================
FILE: Java/core/src/main/java/com/amazon/randomcutforest/VisitorFactory.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package com.amazon.randomcutforest;

import java.util.function.BiFunction;

import com.amazon.randomcutforest.tree.ITree;

/**
 * This is the interface for a visitor factory the factory corresponds to
 * mapping a (tree,point) pair to a visitor and a mapping for the inverse result
 */
public class VisitorFactory<R> implements IVisitorFactory<R> {
    private final BiFunction<ITree<?, ?>, float[], Visitor<R>> newVisitor;
    private final BiFunction<ITree<?, ?>, R, R> liftResult;

    public VisitorFactory(BiFunction<ITree<?, ?>, float[], Visitor<R>> newVisitor,
            BiFunction<ITree<?, ?>, R, R> liftResult) {
        this.newVisitor = newVisitor;
        this.liftResult = liftResult;
    }

    public VisitorFactory(BiFunction<ITree<?, ?>, float[], Visitor<R>> newVisitor) {
        this(newVisitor, (tree, x) -> x);
    }

    @Override
    public Visitor<R> newVisitor(ITree<?, ?> tree, float[] point) {
        return newVisitor.apply(tree, point);
    }

    @Override
    public R liftResult(ITree<?, ?> tree, R result) {
        return liftResult.apply(tree, result);
    }
}


================================================
FILE: Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/AbstractAttributionVisitor.java
================================================
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the 
Download .txt
gitextract_acgcjc4v/

├── .github/
│   ├── draft-release-notes-config.yml
│   └── workflows/
│       ├── draft-release-notes-workflow.yml
│       ├── maven-release.yml
│       ├── maven-snapshot.yml
│       ├── maven.yml
│       └── rust.yml
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Java/
│   ├── README.md
│   ├── RELEASING.md
│   ├── benchmark/
│   │   ├── pom.xml
│   │   └── src/
│   │       └── main/
│   │           └── java/
│   │               └── com/
│   │                   └── amazon/
│   │                       └── randomcutforest/
│   │                           ├── RandomCutForestBenchmark.java
│   │                           ├── RandomCutForestShingledBenchmark.java
│   │                           ├── StateMapperBenchmark.java
│   │                           ├── StateMapperShingledBenchmark.java
│   │                           └── profilers/
│   │                               ├── ObjectGraphSizeProfiler.java
│   │                               └── OutputSizeProfiler.java
│   ├── core/
│   │   ├── pom.xml
│   │   └── src/
│   │       ├── main/
│   │       │   └── java/
│   │       │       └── com/
│   │       │           └── amazon/
│   │       │               └── randomcutforest/
│   │       │                   ├── CommonUtils.java
│   │       │                   ├── ComponentList.java
│   │       │                   ├── IComponentModel.java
│   │       │                   ├── IMultiVisitorFactory.java
│   │       │                   ├── IVisitorFactory.java
│   │       │                   ├── MultiVisitor.java
│   │       │                   ├── MultiVisitorFactory.java
│   │       │                   ├── PredictiveRandomCutForest.java
│   │       │                   ├── RandomCutForest.java
│   │       │                   ├── Visitor.java
│   │       │                   ├── VisitorFactory.java
│   │       │                   ├── anomalydetection/
│   │       │                   │   ├── AbstractAttributionVisitor.java
│   │       │                   │   ├── AbstractScalarScoreVisitor.java
│   │       │                   │   ├── AnomalyAttributionVisitor.java
│   │       │                   │   ├── AnomalyScoreVisitor.java
│   │       │                   │   ├── DynamicAttributionVisitor.java
│   │       │                   │   ├── DynamicScoreVisitor.java
│   │       │                   │   ├── SimulatedTransductiveScalarScoreVisitor.java
│   │       │                   │   └── TransductiveScalarScoreVisitor.java
│   │       │                   ├── config/
│   │       │                   │   ├── Config.java
│   │       │                   │   ├── ForestMode.java
│   │       │                   │   ├── IDynamicConfig.java
│   │       │                   │   ├── ImputationMethod.java
│   │       │                   │   ├── Precision.java
│   │       │                   │   └── TransformMethod.java
│   │       │                   ├── executor/
│   │       │                   │   ├── AbstractForestTraversalExecutor.java
│   │       │                   │   ├── AbstractForestUpdateExecutor.java
│   │       │                   │   ├── AbstractUpdateCoordinator.java
│   │       │                   │   ├── IStateCoordinator.java
│   │       │                   │   ├── ITraversable.java
│   │       │                   │   ├── IUpdatable.java
│   │       │                   │   ├── ParallelForestTraversalExecutor.java
│   │       │                   │   ├── ParallelForestUpdateExecutor.java
│   │       │                   │   ├── PointStoreCoordinator.java
│   │       │                   │   ├── SamplerPlusTree.java
│   │       │                   │   ├── SequentialForestTraversalExecutor.java
│   │       │                   │   ├── SequentialForestUpdateExecutor.java
│   │       │                   │   └── UpdateResult.java
│   │       │                   ├── imputation/
│   │       │                   │   ├── ConditionalSampleSummarizer.java
│   │       │                   │   └── ImputeVisitor.java
│   │       │                   ├── inputtypes/
│   │       │                   │   └── Point.java
│   │       │                   ├── inspect/
│   │       │                   │   └── NearNeighborVisitor.java
│   │       │                   ├── interpolation/
│   │       │                   │   └── SimpleInterpolationVisitor.java
│   │       │                   ├── preprocessor/
│   │       │                   │   ├── IPreprocessor.java
│   │       │                   │   ├── ImputePreprocessor.java
│   │       │                   │   ├── InitialSegmentPreprocessor.java
│   │       │                   │   ├── Preprocessor.java
│   │       │                   │   └── transform/
│   │       │                   │       ├── DifferenceTransformer.java
│   │       │                   │       ├── ITransformer.java
│   │       │                   │       ├── NormalizedDifferenceTransformer.java
│   │       │                   │       ├── NormalizedTransformer.java
│   │       │                   │       ├── SubtractMATransformer.java
│   │       │                   │       └── WeightedTransformer.java
│   │       │                   ├── returntypes/
│   │       │                   │   ├── ConditionalTreeSample.java
│   │       │                   │   ├── ConvergingAccumulator.java
│   │       │                   │   ├── DensityOutput.java
│   │       │                   │   ├── DiVector.java
│   │       │                   │   ├── InterpolationMeasure.java
│   │       │                   │   ├── Neighbor.java
│   │       │                   │   ├── OneSidedConvergingDiVectorAccumulator.java
│   │       │                   │   ├── OneSidedConvergingDoubleAccumulator.java
│   │       │                   │   ├── OneSidedStDevAccumulator.java
│   │       │                   │   ├── RangeVector.java
│   │       │                   │   ├── SampleSummary.java
│   │       │                   │   └── TimedRangeVector.java
│   │       │                   ├── runner/
│   │       │                   │   ├── AnomalyAttributionRunner.java
│   │       │                   │   ├── AnomalyScoreRunner.java
│   │       │                   │   ├── ArgumentParser.java
│   │       │                   │   ├── ImputeRunner.java
│   │       │                   │   ├── LineTransformer.java
│   │       │                   │   ├── SimpleDensityRunner.java
│   │       │                   │   ├── SimpleRunner.java
│   │       │                   │   └── UpdateOnlyTransformer.java
│   │       │                   ├── sampler/
│   │       │                   │   ├── AbstractStreamSampler.java
│   │       │                   │   ├── AcceptPointState.java
│   │       │                   │   ├── CompactSampler.java
│   │       │                   │   ├── ISampled.java
│   │       │                   │   ├── IStreamSampler.java
│   │       │                   │   └── Weighted.java
│   │       │                   ├── state/
│   │       │                   │   ├── ExecutionContext.java
│   │       │                   │   ├── IContextualStateMapper.java
│   │       │                   │   ├── IStateMapper.java
│   │       │                   │   ├── PredictiveRandomCutForestMapper.java
│   │       │                   │   ├── PredictiveRandomCutForestState.java
│   │       │                   │   ├── RandomCutForestMapper.java
│   │       │                   │   ├── RandomCutForestState.java
│   │       │                   │   ├── Version.java
│   │       │                   │   ├── preprocessor/
│   │       │                   │   │   ├── PreprocessorMapper.java
│   │       │                   │   │   └── PreprocessorState.java
│   │       │                   │   ├── returntypes/
│   │       │                   │   │   ├── DiVectorMapper.java
│   │       │                   │   │   └── DiVectorState.java
│   │       │                   │   ├── sampler/
│   │       │                   │   │   ├── CompactSamplerMapper.java
│   │       │                   │   │   └── CompactSamplerState.java
│   │       │                   │   ├── statistics/
│   │       │                   │   │   ├── DeviationMapper.java
│   │       │                   │   │   └── DeviationState.java
│   │       │                   │   ├── store/
│   │       │                   │   │   ├── NodeStoreState.java
│   │       │                   │   │   ├── PointStoreMapper.java
│   │       │                   │   │   └── PointStoreState.java
│   │       │                   │   └── tree/
│   │       │                   │       ├── AbstractNodeStoreMapper.java
│   │       │                   │       ├── CompactRandomCutTreeContext.java
│   │       │                   │       ├── CompactRandomCutTreeState.java
│   │       │                   │       └── RandomCutTreeMapper.java
│   │       │                   ├── statistics/
│   │       │                   │   └── Deviation.java
│   │       │                   ├── store/
│   │       │                   │   ├── IPointStore.java
│   │       │                   │   ├── IPointStoreView.java
│   │       │                   │   ├── IndexIntervalManager.java
│   │       │                   │   ├── PointStore.java
│   │       │                   │   ├── PointStoreLarge.java
│   │       │                   │   ├── PointStoreSmall.java
│   │       │                   │   └── StreamSampler.java
│   │       │                   ├── summarization/
│   │       │                   │   ├── Center.java
│   │       │                   │   ├── GenericMultiCenter.java
│   │       │                   │   ├── ICluster.java
│   │       │                   │   ├── MultiCenter.java
│   │       │                   │   └── Summarizer.java
│   │       │                   ├── tree/
│   │       │                   │   ├── AbstractNodeStore.java
│   │       │                   │   ├── BoundingBox.java
│   │       │                   │   ├── Cut.java
│   │       │                   │   ├── HyperTree.java
│   │       │                   │   ├── IBoundingBoxView.java
│   │       │                   │   ├── INodeView.java
│   │       │                   │   ├── ITree.java
│   │       │                   │   ├── NodeStoreLarge.java
│   │       │                   │   ├── NodeStoreMedium.java
│   │       │                   │   ├── NodeStoreSmall.java
│   │       │                   │   ├── NodeView.java
│   │       │                   │   └── RandomCutTree.java
│   │       │                   └── util/
│   │       │                       ├── ArrayPacking.java
│   │       │                       ├── ArrayUtils.java
│   │       │                       ├── ShingleBuilder.java
│   │       │                       └── Weighted.java
│   │       └── test/
│   │           ├── java/
│   │           │   └── com/
│   │           │       └── amazon/
│   │           │           └── randomcutforest/
│   │           │               ├── AttributionExamplesFunctionalTest.java
│   │           │               ├── CPUTest.java
│   │           │               ├── ConditionalFieldTest.java
│   │           │               ├── DynamicPointSetFunctionalTest.java
│   │           │               ├── ForecastTest.java
│   │           │               ├── MultiCenterTest.java
│   │           │               ├── PredictiveRandomCutForestTest.java
│   │           │               ├── RandomCutForestBuilderTest.java
│   │           │               ├── RandomCutForestConsistencyFunctionalTest.java
│   │           │               ├── RandomCutForestFunctionalTest.java
│   │           │               ├── RandomCutForestShingledFunctionalTest.java
│   │           │               ├── RandomCutForestTest.java
│   │           │               ├── SampleSummaryTest.java
│   │           │               ├── TestUtils.java
│   │           │               ├── anomalydetection/
│   │           │               │   ├── AnomalyAttributionVisitorTest.java
│   │           │               │   ├── AnomalyScoreVisitorTest.java
│   │           │               │   ├── DynamicAttributionVisitorTest.java
│   │           │               │   └── DynamicScoreVisitorTest.java
│   │           │               ├── executor/
│   │           │               │   ├── ForestTraversalExecutorTest.java
│   │           │               │   ├── ForestUpdateExecutorTest.java
│   │           │               │   ├── PointStoreCoordinatorTest.java
│   │           │               │   ├── SamplerPlusTreeTest.java
│   │           │               │   └── UpdateResultTest.java
│   │           │               ├── imputation/
│   │           │               │   ├── ConditionalSampleSummarizerTest.java
│   │           │               │   └── ImputeVisitorTest.java
│   │           │               ├── inspect/
│   │           │               │   └── NearNeighborVisitorTest.java
│   │           │               ├── interpolation/
│   │           │               │   └── SimpleInterpolationVisitorTest.java
│   │           │               ├── preprocessor/
│   │           │               │   ├── PreprocessorTest.java
│   │           │               │   └── transform/
│   │           │               │       └── WeightedTransformerTest.java
│   │           │               ├── returntypes/
│   │           │               │   ├── DensityOutputTest.java
│   │           │               │   ├── DiVectorTest.java
│   │           │               │   ├── InterpolationMeasureTest.java
│   │           │               │   ├── NeighborTest.java
│   │           │               │   ├── OneSidedConvergingDiVectorTest.java
│   │           │               │   ├── OneSidedConvergingDoubleAccumulatorTest.java
│   │           │               │   ├── RangeVectorTest.java
│   │           │               │   ├── SampleSummaryTest.java
│   │           │               │   └── TimedRangeVectorTest.java
│   │           │               ├── runner/
│   │           │               │   ├── AnomalyAttributionRunnerTest.java
│   │           │               │   ├── AnomalyScoreRunnerTest.java
│   │           │               │   ├── ArgumentParserTest.java
│   │           │               │   ├── ImputeRunnerTest.java
│   │           │               │   ├── SimpleDensityRunnerTest.java
│   │           │               │   └── UpdateOnlyTransformerTest.java
│   │           │               ├── sampler/
│   │           │               │   └── CompactSamplerTest.java
│   │           │               ├── state/
│   │           │               │   ├── RandomCutForestMapperTest.java
│   │           │               │   ├── V2PreProcessorJsonResource.java
│   │           │               │   ├── V2RCFJsonResource.java
│   │           │               │   ├── sampler/
│   │           │               │   │   └── CompactSamplerMapperTest.java
│   │           │               │   └── store/
│   │           │               │       └── PointStoreMapperTest.java
│   │           │               ├── statistics/
│   │           │               │   └── StatisticsTest.java
│   │           │               ├── store/
│   │           │               │   ├── PointStoreTest.java
│   │           │               │   └── StreamSamplerTest.java
│   │           │               ├── tree/
│   │           │               │   ├── BoundingBoxTest.java
│   │           │               │   ├── BoxCacheTest.java
│   │           │               │   ├── CutTest.java
│   │           │               │   ├── HyperTreeTest.java
│   │           │               │   └── RandomCutTreeTest.java
│   │           │               └── util/
│   │           │                   ├── ArrayPackingTest.java
│   │           │                   ├── ArrayUtilsTest.java
│   │           │                   ├── ShingleBuilderTest.java
│   │           │                   └── WeightedTest.java
│   │           └── resources/
│   │               └── com/
│   │                   └── amazon/
│   │                       └── randomcutforest/
│   │                           └── state/
│   │                               ├── Preprocessor_1.json
│   │                               ├── Preprocessor_2.json
│   │                               ├── Preprocessor_3.json
│   │                               ├── state_1.json
│   │                               ├── state_2.json
│   │                               └── state_3.json
│   ├── examples/
│   │   ├── pom.xml
│   │   └── src/
│   │       └── main/
│   │           └── java/
│   │               └── com/
│   │                   └── amazon/
│   │                       └── randomcutforest/
│   │                           └── examples/
│   │                               ├── Example.java
│   │                               ├── Main.java
│   │                               ├── dynamicconfiguration/
│   │                               │   ├── DynamicSampling.java
│   │                               │   └── DynamicThroughput.java
│   │                               ├── dynamicinference/
│   │                               │   ├── ConditionalPredictive.java
│   │                               │   ├── DynamicDensity.java
│   │                               │   └── DynamicNearNeighbor.java
│   │                               ├── parkservices/
│   │                               │   ├── ForecastWithLimits.java
│   │                               │   ├── LowNoisePeriodic.java
│   │                               │   ├── NumericGLADexample.java
│   │                               │   ├── RCFCasterExample.java
│   │                               │   ├── ScoringStrategyExample.java
│   │                               │   ├── SequentialAnomalyExample.java
│   │                               │   ├── SequentialForecastExample.java
│   │                               │   ├── StringGLADexample.java
│   │                               │   ├── Thresholded1DGaussianMix.java
│   │                               │   ├── ThresholdedForecast.java
│   │                               │   ├── ThresholdedImpute.java
│   │                               │   ├── ThresholdedInternalShinglingExample.java
│   │                               │   ├── ThresholdedMultiDimensionalExample.java
│   │                               │   ├── ThresholdedPredictive.java
│   │                               │   ├── ThresholdedRCFJsonExample.java
│   │                               │   └── ThresholdedTime.java
│   │                               ├── serialization/
│   │                               │   ├── JsonExample.java
│   │                               │   ├── ObjectStreamExample.java
│   │                               │   ├── ProtostuffExample.java
│   │                               │   ├── ProtostuffExampleWithDynamicLambda.java
│   │                               │   └── ProtostuffExampleWithShingles.java
│   │                               └── summarization/
│   │                                   ├── DynamicSummarization.java
│   │                                   ├── RCFMultiSummarizeExample.java
│   │                                   ├── RCFStringSummarizeExample.java
│   │                                   └── RCFSummarizeExample.java
│   ├── findbugs-filters.xml
│   ├── license-header
│   ├── lombok.config
│   ├── parkservices/
│   │   ├── pom.xml
│   │   └── src/
│   │       ├── main/
│   │       │   └── java/
│   │       │       └── com/
│   │       │           └── amazon/
│   │       │               └── randomcutforest/
│   │       │                   └── parkservices/
│   │       │                       ├── AnomalyDescriptor.java
│   │       │                       ├── ForecastDescriptor.java
│   │       │                       ├── GlobalLocalAnomalyDetector.java
│   │       │                       ├── PredictorCorrector.java
│   │       │                       ├── RCFCaster.java
│   │       │                       ├── SequentialAnalysis.java
│   │       │                       ├── ThresholdedRandomCutForest.java
│   │       │                       ├── calibration/
│   │       │                       │   └── ErrorHandler.java
│   │       │                       ├── config/
│   │       │                       │   ├── Calibration.java
│   │       │                       │   ├── CorrectionMode.java
│   │       │                       │   └── ScoringStrategy.java
│   │       │                       ├── returntypes/
│   │       │                       │   ├── AnalysisDescriptor.java
│   │       │                       │   ├── GenericAnomalyDescriptor.java
│   │       │                       │   └── RCFComputeDescriptor.java
│   │       │                       ├── state/
│   │       │                       │   ├── RCFCasterMapper.java
│   │       │                       │   ├── RCFCasterState.java
│   │       │                       │   ├── ThresholdedRandomCutForestMapper.java
│   │       │                       │   ├── ThresholdedRandomCutForestState.java
│   │       │                       │   ├── errorhandler/
│   │       │                       │   │   ├── ErrorHandlerMapper.java
│   │       │                       │   │   └── ErrorHandlerState.java
│   │       │                       │   ├── predictorcorrector/
│   │       │                       │   │   ├── PredictorCorrectorMapper.java
│   │       │                       │   │   └── PredictorCorrectorState.java
│   │       │                       │   ├── returntypes/
│   │       │                       │   │   ├── ComputeDescriptorMapper.java
│   │       │                       │   │   └── ComputeDescriptorState.java
│   │       │                       │   └── threshold/
│   │       │                       │       ├── BasicThresholderMapper.java
│   │       │                       │       └── BasicThresholderState.java
│   │       │                       └── threshold/
│   │       │                           └── BasicThresholder.java
│   │       └── test/
│   │           ├── java/
│   │           │   └── com/
│   │           │       └── amazon/
│   │           │           └── randomcutforest/
│   │           │               └── parkservices/
│   │           │                   ├── AnomalyDescriptorTest.java
│   │           │                   ├── ConsistencyTest.java
│   │           │                   ├── DescriptorTest.java
│   │           │                   ├── ForecastTest.java
│   │           │                   ├── IgnoreTest.java
│   │           │                   ├── MissingValueTest.java
│   │           │                   ├── PredictorCorrectorTest.java
│   │           │                   ├── RCFCasterTest.java
│   │           │                   ├── SequentialAnalysisTest.java
│   │           │                   ├── TestGlobalLocalAnomalyDetector.java
│   │           │                   ├── ThresholdedRandomCutForestTest.java
│   │           │                   ├── TransformTest.java
│   │           │                   ├── calibration/
│   │           │                   │   └── ErrorHandlerTest.java
│   │           │                   ├── state/
│   │           │                   │   ├── RCFCasterMapperTest.java
│   │           │                   │   ├── ThresholdedRandomCutForestMapperTest.java
│   │           │                   │   ├── V2TRCFByteBase64Resource.java
│   │           │                   │   ├── V2TRCFJsonResource.java
│   │           │                   │   └── V2TRCFToV3StateConverterTest.java
│   │           │                   └── threshold/
│   │           │                       └── BasicThresholderTest.java
│   │           └── resources/
│   │               └── com/
│   │                   └── amazon/
│   │                       └── randomcutforest/
│   │                           └── parkservices/
│   │                               └── state/
│   │                                   ├── byte_base64_1.txt
│   │                                   ├── byte_base64_2.txt
│   │                                   ├── state_1.json
│   │                                   └── state_2.json
│   ├── pom.xml
│   ├── serialization/
│   │   ├── pom.xml
│   │   └── src/
│   │       ├── main/
│   │       │   └── java/
│   │       │       └── com/
│   │       │           └── amazon/
│   │       │               └── randomcutforest/
│   │       │                   └── serialize/
│   │       │                       └── json/
│   │       │                           ├── v1/
│   │       │                           │   ├── V1JsonToV3StateConverter.java
│   │       │                           │   └── V1SerializedRandomCutForest.java
│   │       │                           └── v2/
│   │       │                               └── V2StateToV3ForestConverter.java
│   │       └── test/
│   │           ├── java/
│   │           │   └── com/
│   │           │       └── amazon/
│   │           │           └── randomcutforest/
│   │           │               └── serialize/
│   │           │                   └── json/
│   │           │                       └── v1/
│   │           │                           ├── V1JsonResource.java
│   │           │                           └── V1JsonToV3StateConverterTest.java
│   │           └── resources/
│   │               └── com/
│   │                   └── amazon/
│   │                       └── randomcutforest/
│   │                           └── serialize/
│   │                               └── json/
│   │                                   └── v1/
│   │                                       ├── forest_1.json
│   │                                       └── forest_2.json
│   ├── spotless-eclipse.xml
│   └── testutils/
│       ├── pom.xml
│       └── src/
│           └── main/
│               └── java/
│                   └── com/
│                       └── amazon/
│                           └── randomcutforest/
│                               └── testutils/
│                                   ├── ExampleDataSets.java
│                                   ├── MultiDimDataWithKey.java
│                                   ├── NormalMixtureTestData.java
│                                   ├── ShingledData.java
│                                   └── ShingledMultiDimDataWithKeys.java
├── LICENSE
├── NOTICE
├── README.md
├── Rust/
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── README.md
│   ├── rustfmt.toml
│   ├── src/
│   │   ├── common/
│   │   │   ├── cluster.rs
│   │   │   ├── conditionalfieldsummarizer.rs
│   │   │   ├── descriptor.rs
│   │   │   ├── deviation.rs
│   │   │   ├── directionaldensity.rs
│   │   │   ├── divector.rs
│   │   │   ├── intervalstoremanager.rs
│   │   │   ├── mod.rs
│   │   │   ├── multidimdatawithkey.rs
│   │   │   ├── rangevector.rs
│   │   │   └── samplesummary.rs
│   │   ├── errors.rs
│   │   ├── example.rs
│   │   ├── glad.rs
│   │   ├── lib.rs
│   │   ├── pointstore.rs
│   │   ├── rcf.rs
│   │   ├── samplerplustree/
│   │   │   ├── boundingbox.rs
│   │   │   ├── cut.rs
│   │   │   ├── mod.rs
│   │   │   ├── nodestore.rs
│   │   │   ├── nodeview.rs
│   │   │   ├── randomcuttree.rs
│   │   │   ├── sampler.rs
│   │   │   └── samplerplustree.rs
│   │   ├── trcf/
│   │   │   ├── basicthresholder.rs
│   │   │   ├── basictrcf.rs
│   │   │   ├── errorhandler.rs
│   │   │   ├── mod.rs
│   │   │   ├── multitrcf.rs
│   │   │   ├── predictorcorrector.rs
│   │   │   ├── preprocessor.rs
│   │   │   ├── rcfcaster.rs
│   │   │   ├── transformer.rs
│   │   │   └── types.rs
│   │   ├── types.rs
│   │   ├── util.rs
│   │   └── visitor/
│   │       ├── attributionvisitor.rs
│   │       ├── imputevisitor.rs
│   │       ├── interpolationvisitor.rs
│   │       ├── mod.rs
│   │       ├── scalarscorevisitor.rs
│   │       └── visitor.rs
│   └── tests/
│       ├── anomalydetectionattributionupdate.rs
│       ├── anomalydetectionimputescoreupdate.rs
│       ├── anomalydetectionscoreupdate.rs
│       ├── basicrcftest.rs
│       ├── basictrcftest.rs
│       ├── clustertest.rs
│       ├── dynamicdensitytest.rs
│       ├── gladtest.rs
│       ├── imputedifferentperiod.rs
│       ├── imputesameperiod.rs
│       ├── multitrcftest.rs
│       └── samplesummarytest.rs
├── THIRD-PARTY
├── example-data/
│   └── rcf-paper.csv
└── python_rcf_wrapper/
    ├── README.md
    ├── __init__.py
    ├── lib/
    │   ├── randomcutforest-core-4.0.0-SNAPSHOT.jar
    │   └── randomcutforest-parkservices-4.0.0-SNAPSHOT.jar
    ├── rcf_model.py
    └── trcf_model.py
Download .txt
Showing preview only (320K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3627 symbols across 340 files)

FILE: Java/benchmark/src/main/java/com/amazon/randomcutforest/RandomCutForestBenchmark.java
  class RandomCutForestBenchmark (line 38) | @Warmup(iterations = 2)
    class BenchmarkState (line 47) | @State(Scope.Benchmark)
      method setUpData (line 67) | @Setup(Level.Trial)
      method setUpForest (line 74) | @Setup(Level.Invocation)
    method updateOnly (line 88) | @Benchmark
    method scoreOnly (line 101) | @Benchmark
    method scoreAndUpdate (line 120) | @Benchmark
    method attributionAndUpdate (line 136) | @Benchmark
    method basicDensityAndUpdate (line 152) | @Benchmark
    method basicNeighborAndUpdate (line 168) | @Benchmark
    method imputeAndUpdate (line 184) | @Benchmark

FILE: Java/benchmark/src/main/java/com/amazon/randomcutforest/RandomCutForestShingledBenchmark.java
  class RandomCutForestShingledBenchmark (line 38) | @Warmup(iterations = 2)
    class BenchmarkState (line 47) | @State(Scope.Benchmark)
      method setUpData (line 67) | @Setup(Level.Trial)
      method setUpForest (line 73) | @Setup(Level.Invocation)
    method updateOnly (line 87) | @Benchmark
    method scoreOnly (line 100) | @Benchmark
    method scoreAndUpdate (line 119) | @Benchmark
    method attributionAndUpdate (line 135) | @Benchmark
    method basicDensityAndUpdate (line 151) | @Benchmark
    method neighborAndUpdate (line 167) | @Benchmark
    method imputeAndUpdate (line 183) | @Benchmark
    method extrapolateAndUpdate (line 199) | @Benchmark

FILE: Java/benchmark/src/main/java/com/amazon/randomcutforest/StateMapperBenchmark.java
  class StateMapperBenchmark (line 45) | @Warmup(iterations = 2)
    class BenchmarkState (line 53) | @State(Scope.Thread)
      method setUpData (line 76) | @Setup(Level.Trial)
      method setUpForest (line 83) | @Setup(Level.Invocation)
    method tearDown (line 114) | @TearDown(Level.Iteration)
    method roundTripFromState (line 120) | @Benchmark
    method roundTripFromJson (line 140) | @Benchmark
    method roundTripFromProtostuff (line 165) | @Benchmark

FILE: Java/benchmark/src/main/java/com/amazon/randomcutforest/StateMapperShingledBenchmark.java
  class StateMapperShingledBenchmark (line 48) | @Warmup(iterations = 2)
    class BenchmarkState (line 56) | @State(Scope.Thread)
      method setUpData (line 79) | @Setup(Level.Trial)
      method setUpForest (line 85) | @Setup(Level.Invocation)
    method tearDown (line 115) | @TearDown(Level.Iteration)
    method roundTripFromState (line 120) | @Benchmark
    method roundTripFromJson (line 140) | @Benchmark
    method roundTripFromProtostuff (line 165) | @Benchmark
    method genShingledData (line 197) | private static double[][] genShingledData(int size, int dimensions, lo...
    method getShinglePoint (line 218) | private static double[] getShinglePoint(double[] recentPointsSeen, int...
    method getDataD (line 229) | private static double[] getDataD(int num, double amplitude, double noi...

FILE: Java/benchmark/src/main/java/com/amazon/randomcutforest/profilers/ObjectGraphSizeProfiler.java
  class ObjectGraphSizeProfiler (line 34) | public class ObjectGraphSizeProfiler implements InternalProfiler {
    method setObject (line 39) | public static void setObject(Object object) {
    method beforeIteration (line 43) | @Override
    method afterIteration (line 47) | @Override
    method getDescription (line 59) | @Override

FILE: Java/benchmark/src/main/java/com/amazon/randomcutforest/profilers/OutputSizeProfiler.java
  class OutputSizeProfiler (line 34) | public class OutputSizeProfiler implements InternalProfiler {
    method setTestString (line 38) | public static void setTestString(String s) {
    method setTestArray (line 42) | public static void setTestArray(byte[] bytes) {
    method beforeIteration (line 46) | @Override
    method afterIteration (line 50) | @Override
    method getDescription (line 62) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/CommonUtils.java
  class CommonUtils (line 26) | public class CommonUtils {
    method CommonUtils (line 28) | private CommonUtils() {
    method checkArgument (line 41) | public static void checkArgument(boolean condition, String message) {
    method checkArgument (line 49) | public static void checkArgument(boolean condition, Supplier<String> m...
    method checkState (line 64) | public static void checkState(boolean condition, String message) {
    method validateInternalState (line 79) | public static void validateInternalState(boolean condition, String mes...
    method checkNotNull (line 96) | public static <T> T checkNotNull(T object, String message) {
    method getProbabilityOfSeparation (line 112) | public static double getProbabilityOfSeparation(final IBoundingBoxView...
    method defaultScoreSeenFunction (line 148) | public static double defaultScoreSeenFunction(double depth, double mas...
    method defaultScoreUnseenFunction (line 160) | public static double defaultScoreUnseenFunction(double depth, double m...
    method defaultDampFunction (line 164) | public static double defaultDampFunction(double leafMass, double treeM...
    method defaultScalarNormalizerFunction (line 179) | public static double defaultScalarNormalizerFunction(double scalarValu...
    method defaultRCFgVecFunction (line 195) | public static double[] defaultRCFgVecFunction(IBoundingBoxView boundin...
    method toDoubleArray (line 211) | public static double[] toDoubleArray(float[] array) {
    method toDoubleArrayNullable (line 220) | public static double[] toDoubleArrayNullable(float[] array) {
    method toFloatArray (line 224) | public static float[] toFloatArray(double[] array) {
    method toFloatArrayNullable (line 234) | public static float[] toFloatArrayNullable(double[] array) {
    method toIntArray (line 238) | public static int[] toIntArray(byte[] values) {
    method toIntArray (line 247) | public static int[] toIntArray(char[] values) {
    method toCharArray (line 256) | public static char[] toCharArray(int[] values) {
    method toByteArray (line 265) | public static byte[] toByteArray(int[] values) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/ComponentList.java
  class ComponentList (line 29) | public class ComponentList<PointReference, Point> extends ArrayList<ICom...
    method ComponentList (line 30) | public ComponentList() {
    method ComponentList (line 34) | public ComponentList(Collection<? extends IComponentModel<PointReferen...
    method ComponentList (line 38) | public ComponentList(int initialCapacity) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/IComponentModel.java
  type IComponentModel (line 29) | public interface IComponentModel<PointReference, Point>

FILE: Java/core/src/main/java/com/amazon/randomcutforest/IMultiVisitorFactory.java
  type IMultiVisitorFactory (line 20) | @FunctionalInterface
    method newVisitor (line 22) | MultiVisitor<R> newVisitor(ITree<?, ?> tree, float[] point);
    method liftResult (line 24) | default R liftResult(ITree<?, ?> tree, R result) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/IVisitorFactory.java
  type IVisitorFactory (line 20) | @FunctionalInterface
    method newVisitor (line 22) | Visitor<R> newVisitor(ITree<?, ?> tree, float[] point);
    method liftResult (line 24) | default R liftResult(ITree<?, ?> tree, R result) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/MultiVisitor.java
  type MultiVisitor (line 28) | public interface MultiVisitor<R> extends Visitor<R> {
    method trigger (line 38) | boolean trigger(final INodeView node);
    method newPartialCopy (line 47) | MultiVisitor<R> newPartialCopy();
    method combine (line 56) | void combine(MultiVisitor<R> other);

FILE: Java/core/src/main/java/com/amazon/randomcutforest/MultiVisitorFactory.java
  class MultiVisitorFactory (line 31) | public class MultiVisitorFactory<R> implements IMultiVisitorFactory<R> {
    method MultiVisitorFactory (line 35) | public MultiVisitorFactory(BiFunction<ITree<?, ?>, float[], MultiVisit...
    method MultiVisitorFactory (line 41) | public MultiVisitorFactory(BiFunction<ITree<?, ?>, float[], MultiVisit...
    method newVisitor (line 45) | @Override
    method liftResult (line 50) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/PredictiveRandomCutForest.java
  class PredictiveRandomCutForest (line 69) | public class PredictiveRandomCutForest {
    method PredictiveRandomCutForest (line 79) | public PredictiveRandomCutForest(Builder<?> builder) {
    method PredictiveRandomCutForest (line 121) | public PredictiveRandomCutForest(ForestMode forestMode, TransformMetho...
    method validateNonNegativeArray (line 129) | void validateNonNegativeArray(double[] array) {
    method predict (line 164) | public SampleSummary predict(float[] inputPoint, long timestamp, int[]...
    method predict (line 192) | public SampleSummary predict(float[] inputPoint, long timestamp, int[]...
    method neighborSummary (line 206) | public SampleSummary neighborSummary(float[] inputPoint, long timestam...
    method getExpectedInverseDepthScore (line 226) | public double getExpectedInverseDepthScore(float[] inputPoint, long ti...
    method getExpectedInverseDepthAttribution (line 249) | public DiVector getExpectedInverseDepthAttribution(float[] inputPoint,...
    method getSimpleDensity (line 270) | public DensityOutput getSimpleDensity(float[] inputPoint, long timesta...
    method getRCFDistanceAttribution (line 300) | public DiVector getRCFDistanceAttribution(float[] inputPoint, long tim...
    method update (line 305) | public void update(float[] record, long timestamp) {
    method update (line 309) | public void update(float[] record, long timestamp, int[] missing) {
    method getForest (line 314) | public RandomCutForest getForest() {
    method getPreprocessor (line 318) | public IPreprocessor getPreprocessor() {
    method getForestMode (line 322) | public ForestMode getForestMode() {
    method getTransformMethod (line 326) | public TransformMethod getTransformMethod() {
    method builder (line 333) | public static Builder<?> builder() {
    class Builder (line 337) | public static class Builder<T extends Builder<T>> {
      method validate (line 369) | void validate() {
      method build (line 414) | public PredictiveRandomCutForest build() {
      method buildForest (line 419) | protected RandomCutForest buildForest() {
      method inputDimensions (line 437) | public T inputDimensions(int dimensions) {
      method sampleSize (line 442) | public T sampleSize(int sampleSize) {
      method startNormalization (line 447) | public T startNormalization(int startNormalization) {
      method stopNormalization (line 452) | public T stopNormalization(int stopNormalization) {
      method outputAfter (line 457) | public T outputAfter(int outputAfter) {
      method numberOfTrees (line 462) | public T numberOfTrees(int numberOfTrees) {
      method shingleSize (line 467) | public T shingleSize(int shingleSize) {
      method timeDecay (line 472) | public T timeDecay(double timeDecay) {
      method transformDecay (line 477) | public T transformDecay(double transformDecay) {
      method randomSeed (line 482) | public T randomSeed(long randomSeed) {
      method centerOfMassEnabled (line 487) | public T centerOfMassEnabled(boolean centerOfMassEnabled) {
      method parallelExecutionEnabled (line 492) | public T parallelExecutionEnabled(boolean parallelExecutionEnabled) {
      method forestMode (line 497) | public T forestMode(ForestMode forestMode) {
      method threadPoolSize (line 502) | public T threadPoolSize(int threadPoolSize) {
      method storeSequenceIndexesEnabled (line 507) | public T storeSequenceIndexesEnabled(boolean storeSequenceIndexesEna...
      method boundingBoxCacheFraction (line 512) | public T boundingBoxCacheFraction(double boundingBoxCacheFraction) {
      method initialAcceptFraction (line 517) | public T initialAcceptFraction(double initialAcceptFraction) {
      method getRandom (line 522) | public Random getRandom() {
      method weights (line 528) | public T weights(double[] values) {
      method imputationMethod (line 534) | public T imputationMethod(ImputationMethod imputationMethod) {
      method transformMethod (line 539) | public T transformMethod(TransformMethod method) {
      method fillValues (line 544) | public T fillValues(double[] values) {
      method useImputedFraction (line 550) | public T useImputedFraction(double fraction) {
      method weightTime (line 555) | public T weightTime(double value) {
      method normalizeTime (line 560) | public T normalizeTime(boolean normalizeTime) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/RandomCutForest.java
  class RandomCutForest (line 89) | public class RandomCutForest {
    method RandomCutForest (line 266) | public <P> RandomCutForest(Builder<?> builder, IStateCoordinator<P, fl...
    method RandomCutForest (line 280) | public RandomCutForest(Builder<?> builder) {
    method initExecutors (line 308) | protected <PointReference> void initExecutors(IStateCoordinator<PointR...
    method RandomCutForest (line 330) | protected RandomCutForest(Builder<?> builder, boolean notUsed) {
    method builder (line 376) | public static Builder builder() {
    method defaultForest (line 388) | public static RandomCutForest defaultForest(int dimensions, long rando...
    method defaultForest (line 398) | public static RandomCutForest defaultForest(int dimensions) {
    method getNumberOfTrees (line 405) | public int getNumberOfTrees() {
    method getSampleSize (line 412) | public int getSampleSize() {
    method getShingleSize (line 419) | public int getShingleSize() {
    method getOutputAfter (line 427) | public int getOutputAfter() {
    method getDimensions (line 434) | public int getDimensions() {
    method getTimeDecay (line 441) | public double getTimeDecay() {
    method isStoreSequenceIndexesEnabled (line 448) | public boolean isStoreSequenceIndexesEnabled() {
    method getPrecision (line 460) | public Precision getPrecision() {
    method isCompact (line 464) | @Deprecated
    method isInternalShinglingEnabled (line 472) | public boolean isInternalShinglingEnabled() {
    method isCenterOfMassEnabled (line 479) | public boolean isCenterOfMassEnabled() {
    method isParallelExecutionEnabled (line 486) | public boolean isParallelExecutionEnabled() {
    method getBoundingBoxCacheFraction (line 490) | public double getBoundingBoxCacheFraction() {
    method getThreadPoolSize (line 498) | public int getThreadPoolSize() {
    method getUpdateCoordinator (line 502) | public IStateCoordinator<?, ?> getUpdateCoordinator() {
    method getComponents (line 506) | public ComponentList<?, ?> getComponents() {
    method transformToShingledPoint (line 518) | public float[] transformToShingledPoint(float[] point) {
    method isRotationEnabled (line 527) | public boolean isRotationEnabled() {
    method transformIndices (line 539) | protected int[] transformIndices(int[] indexList, int length) {
    method lastShingledPoint (line 549) | public float[] lastShingledPoint() {
    method nextSequenceIndex (line 560) | public long nextSequenceIndex() {
    method update (line 574) | public void update(float[] point, boolean updateShingleOnly) {
    method update (line 586) | @Deprecated
    method update (line 591) | public void update(float[] point) {
    method update (line 604) | public void update(double[] point, long sequenceNum) {
    method update (line 609) | public void update(float[] point, long sequenceNum) {
    method setBoundingBoxCacheFraction (line 623) | public void setBoundingBoxCacheFraction(double cacheFraction) {
    method setTimeDecay (line 634) | public void setTimeDecay(double timeDecay) {
    method traverseForest (line 663) | public <R, S> S traverseForest(float[] point, IVisitorFactory<R> visit...
    method traverseForest (line 696) | public <R, S> S traverseForest(float[] point, IVisitorFactory<R> visit...
    method traverseForest (line 731) | public <R, S> S traverseForest(float[] point, IVisitorFactory<R> visit...
    method traverseForestMulti (line 765) | public <R, S> S traverseForestMulti(float[] point, IMultiVisitorFactor...
    method traverseForestMulti (line 798) | public <R, S> S traverseForestMulti(float[] point, IMultiVisitorFactor...
    method getAnomalyScore (line 822) | @Deprecated
    method getAnomalyScore (line 827) | public double getAnomalyScore(float[] point) {
    method getApproximateAnomalyScore (line 853) | @Deprecated
    method getApproximateAnomalyScore (line 858) | public double getApproximateAnomalyScore(float[] point) {
    method getAnomalyAttribution (line 887) | public DiVector getAnomalyAttribution(double[] point) {
    method getAnomalyAttribution (line 891) | public DiVector getAnomalyAttribution(float[] point) {
    method getApproximateAnomalyAttribution (line 915) | public DiVector getApproximateAnomalyAttribution(double[] point) {
    method getApproximateAnomalyAttribution (line 919) | public DiVector getApproximateAnomalyAttribution(float[] point) {
    method getSimpleDensity (line 946) | @Deprecated
    method getSimpleDensity (line 951) | public DensityOutput getSimpleDensity(float[] point) {
    method getConditionalField (line 985) | protected List<ConditionalTreeSample> getConditionalField(float[] poin...
    method getConditionalFieldSummary (line 1026) | public SampleSummary getConditionalFieldSummary(float[] point, int[] m...
    method imputeMissingValues (line 1056) | public float[] imputeMissingValues(float[] point, int[] missingIndexes) {
    method imputeMissingValues (line 1061) | @Deprecated
    method imputeMissingValues (line 1066) | @Deprecated
    method extrapolateBasic (line 1089) | @Deprecated
    method extrapolateBasic (line 1094) | @Deprecated
    method extrapolateWithRanges (line 1102) | public RangeVector extrapolateWithRanges(float[] point, int horizon, i...
    method extrapolateFromShingle (line 1127) | @Deprecated
    method extrapolateBasic (line 1147) | @Deprecated
    method extrapolateBasic (line 1152) | protected float[] extrapolateBasic(float[] point, int horizon, int blo...
    method extrapolateBasic (line 1166) | @Deprecated
    method extrapolateBasicSliding (line 1172) | void extrapolateBasicSliding(RangeVector result, int horizon, int bloc...
    method extrapolateBasicCyclic (line 1196) | void extrapolateBasicCyclic(RangeVector result, int horizon, int block...
    method extrapolate (line 1231) | public double[] extrapolate(int horizon) {
    method extrapolateFromCurrentTime (line 1235) | public float[] extrapolateFromCurrentTime(int horizon) {
    method getNearNeighborsInSample (line 1259) | @Deprecated
    method getNearNeighborsInSample (line 1264) | public List<Neighbor> getNearNeighborsInSample(float[] point, double d...
    method getNearNeighborsInSample (line 1290) | @Deprecated
    method getNearNeighborsInSample (line 1295) | public List<Neighbor> getNearNeighborsInSample(float[] point) {
    method isOutputReady (line 1302) | public boolean isOutputReady() {
    method samplersFull (line 1310) | public boolean samplersFull() {
    method getTotalUpdates (line 1321) | public long getTotalUpdates() {
    method pauseSampling (line 1325) | public void pauseSampling() {
    method resumeSampling (line 1329) | public void resumeSampling() {
    method isCurrentlySampling (line 1333) | public boolean isCurrentlySampling() {
    method summarize (line 1376) | public List<ICluster<float[]>> summarize(int maxAllowed, double shrink...
    method summarize (line 1383) | public List<ICluster<float[]>> summarize(int maxAllowed, double shrink...
    class Builder (line 1389) | public static class Builder<T extends Builder<T>> {
      method dimensions (line 1413) | public T dimensions(int dimensions) {
      method sampleSize (line 1418) | public T sampleSize(int sampleSize) {
      method outputAfter (line 1423) | public T outputAfter(int outputAfter) {
      method numberOfTrees (line 1428) | public T numberOfTrees(int numberOfTrees) {
      method shingleSize (line 1433) | public T shingleSize(int shingleSize) {
      method timeDecay (line 1438) | public T timeDecay(double timeDecay) {
      method randomSeed (line 1443) | public T randomSeed(long randomSeed) {
      method centerOfMassEnabled (line 1448) | public T centerOfMassEnabled(boolean centerOfMassEnabled) {
      method parallelExecutionEnabled (line 1453) | public T parallelExecutionEnabled(boolean parallelExecutionEnabled) {
      method threadPoolSize (line 1458) | public T threadPoolSize(int threadPoolSize) {
      method initialPointStoreSize (line 1463) | public T initialPointStoreSize(int initialPointStoreSize) {
      method storeSequenceIndexesEnabled (line 1468) | public T storeSequenceIndexesEnabled(boolean storeSequenceIndexesEna...
      method compact (line 1473) | @Deprecated
      method internalShinglingEnabled (line 1478) | public T internalShinglingEnabled(boolean internalShinglingEnabled) {
      method internalRotationEnabled (line 1483) | public T internalRotationEnabled(boolean internalRotationEnabled) {
      method dynamicResizingEnabled (line 1488) | @Deprecated
      method precision (line 1493) | @Deprecated
      method boundingBoxCacheFraction (line 1498) | public T boundingBoxCacheFraction(double boundingBoxCacheFraction) {
      method initialAcceptFraction (line 1503) | public T initialAcceptFraction(double initialAcceptFraction) {
      method build (line 1508) | public RandomCutForest build() {
      method getRandom (line 1512) | public Random getRandom() {
    method getDynamicScore (line 1532) | public double getDynamicScore(float[] point, int ignoreLeafMassThresho...
    method getDynamicSimulatedScore (line 1572) | public double getDynamicSimulatedScore(float[] point, BiFunction<Doubl...
    method getApproximateDynamicScore (line 1611) | public double getApproximateDynamicScore(float[] point, double precisi...
    method getDynamicAttribution (line 1644) | public DiVector getDynamicAttribution(float[] point, int ignoreLeafMas...
    method getApproximateDynamicAttribution (line 1678) | public DiVector getApproximateDynamicAttribution(float[] point, double...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/Visitor.java
  type Visitor (line 30) | public interface Visitor<R> {
    method accept (line 37) | void accept(INodeView node, int depthOfNode);
    method acceptLeaf (line 46) | default void acceptLeaf(INodeView leafNode, final int depthOfNode) {
    method getResult (line 56) | R getResult();
    method isConverged (line 73) | default boolean isConverged() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/VisitorFactory.java
  class VisitorFactory (line 26) | public class VisitorFactory<R> implements IVisitorFactory<R> {
    method VisitorFactory (line 30) | public VisitorFactory(BiFunction<ITree<?, ?>, float[], Visitor<R>> new...
    method VisitorFactory (line 36) | public VisitorFactory(BiFunction<ITree<?, ?>, float[], Visitor<R>> new...
    method newVisitor (line 40) | @Override
    method liftResult (line 45) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/AbstractAttributionVisitor.java
  class AbstractAttributionVisitor (line 40) | public abstract class AbstractAttributionVisitor implements Visitor<DiVe...
    method AbstractAttributionVisitor (line 70) | public AbstractAttributionVisitor(float[] pointToScore, int treeMass, ...
    method AbstractAttributionVisitor (line 87) | public AbstractAttributionVisitor(float[] pointToScore, int treeMass) {
    method getResult (line 99) | @Override
    method accept (line 112) | @Override
    method acceptLeaf (line 169) | @Override
    method scoreSeen (line 207) | protected abstract double scoreSeen(int depth, int mass);
    method scoreUnseen (line 218) | protected abstract double scoreUnseen(int depth, int mass);
    method damp (line 229) | protected abstract double damp(int leafMass, int treeMass);
    method updateRangesForScoring (line 242) | protected void updateRangesForScoring(IBoundingBoxView smallBox, IBoun...
    method isConverged (line 270) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/AbstractScalarScoreVisitor.java
  class AbstractScalarScoreVisitor (line 45) | public abstract class AbstractScalarScoreVisitor implements Visitor<Doub...
    method AbstractScalarScoreVisitor (line 111) | public AbstractScalarScoreVisitor(float[] pointToScore, int treeMass, ...
    method AbstractScalarScoreVisitor (line 130) | public AbstractScalarScoreVisitor(float[] pointToScore, int treeMass) {
    method getResult (line 137) | @Override
    method accept (line 148) | @Override
    method acceptLeaf (line 176) | @Override
    method scoreSeen (line 196) | protected abstract double scoreSeen(int depth, int mass);
    method scoreUnseen (line 207) | protected abstract double scoreUnseen(int depth, int mass);
    method damp (line 218) | protected abstract double damp(int leafMass, int treeMass);
    method getProbabilityOfSeparation (line 230) | protected double getProbabilityOfSeparation(final IBoundingBoxView bou...
    method isConverged (line 270) | public boolean isConverged() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/AnomalyAttributionVisitor.java
  class AnomalyAttributionVisitor (line 34) | public class AnomalyAttributionVisitor extends AbstractAttributionVisitor {
    method AnomalyAttributionVisitor (line 36) | public AnomalyAttributionVisitor(float[] pointToScore, int treeMass, i...
    method AnomalyAttributionVisitor (line 40) | public AnomalyAttributionVisitor(float[] pointToScore, int treeMass) {
    method scoreSeen (line 44) | @Override
    method scoreUnseen (line 49) | @Override
    method damp (line 54) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/AnomalyScoreVisitor.java
  class AnomalyScoreVisitor (line 33) | public class AnomalyScoreVisitor extends AbstractScalarScoreVisitor {
    method AnomalyScoreVisitor (line 42) | public AnomalyScoreVisitor(float[] pointToScore, int treeMass) {
    method AnomalyScoreVisitor (line 55) | public AnomalyScoreVisitor(float[] pointToScore, int treeMass, int ign...
    method scoreSeen (line 59) | @Override
    method scoreUnseen (line 64) | @Override
    method damp (line 69) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/DynamicAttributionVisitor.java
  class DynamicAttributionVisitor (line 22) | public class DynamicAttributionVisitor extends AbstractAttributionVisitor {
    method DynamicAttributionVisitor (line 60) | public DynamicAttributionVisitor(float[] point, int treeMass, int igno...
    method scoreSeen (line 69) | @Override
    method scoreUnseen (line 74) | @Override
    method damp (line 79) | @Override
    method getResult (line 86) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/DynamicScoreVisitor.java
  class DynamicScoreVisitor (line 20) | public class DynamicScoreVisitor extends AbstractScalarScoreVisitor {
    method DynamicScoreVisitor (line 60) | public DynamicScoreVisitor(float[] point, int treeMass, int ignoreLeaf...
    method scoreSeen (line 69) | @Override
    method scoreUnseen (line 74) | @Override
    method damp (line 79) | @Override
    method getResult (line 89) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/SimulatedTransductiveScalarScoreVisitor.java
  class SimulatedTransductiveScalarScoreVisitor (line 24) | public class SimulatedTransductiveScalarScoreVisitor extends Transductiv...
    method SimulatedTransductiveScalarScoreVisitor (line 45) | public SimulatedTransductiveScalarScoreVisitor(float[] pointToScore, i...
    method accept (line 59) | @Override
    method isConverged (line 81) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/TransductiveScalarScoreVisitor.java
  class TransductiveScalarScoreVisitor (line 24) | public class TransductiveScalarScoreVisitor extends DynamicScoreVisitor {
    method TransductiveScalarScoreVisitor (line 58) | public TransductiveScalarScoreVisitor(float[] pointToScore, int treeMass,
    method accept (line 72) | @Override
    method getProbabilityOfSeparation (line 102) | @Override
    method getWeight (line 150) | protected double getWeight(int dim, Function<IBoundingBoxView, double[...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/config/Config.java
  class Config (line 18) | public class Config {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/config/ForestMode.java
  type ForestMode (line 21) | public enum ForestMode {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/config/IDynamicConfig.java
  type IDynamicConfig (line 23) | public interface IDynamicConfig {
    method setConfig (line 25) | <T> void setConfig(String name, T value, Class<T> clazz);
    method setConfig (line 27) | default void setConfig(String name, short value) {
    method setConfig (line 31) | default void setConfig(String name, int value) {
    method setConfig (line 35) | default void setConfig(String name, long value) {
    method setConfig (line 39) | default void setConfig(String name, float value) {
    method setConfig (line 43) | default void setConfig(String name, double value) {
    method setConfig (line 47) | default void setConfig(String name, boolean value) {
    method getConfig (line 51) | <T> T getConfig(String name, Class<T> clazz);
    method getConfig (line 53) | default Object getConfig(String name) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/config/ImputationMethod.java
  type ImputationMethod (line 21) | public enum ImputationMethod {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/config/Precision.java
  type Precision (line 21) | public enum Precision {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/config/TransformMethod.java
  type TransformMethod (line 25) | public enum TransformMethod {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/executor/AbstractForestTraversalExecutor.java
  class AbstractForestTraversalExecutor (line 27) | public abstract class AbstractForestTraversalExecutor {
    method AbstractForestTraversalExecutor (line 31) | protected AbstractForestTraversalExecutor(ComponentList<?, ?> componen...
    method traverseForest (line 56) | public abstract <R, S> S traverseForest(float[] point, IVisitorFactory...
    method traverseForest (line 79) | public abstract <R, S> S traverseForest(float[] point, IVisitorFactory...
    method traverseForest (line 106) | public abstract <R, S> S traverseForest(float[] point, IVisitorFactory...
    method traverseForestMulti (line 130) | public abstract <R, S> S traverseForestMulti(float[] point, IMultiVisi...
    method traverseForestMulti (line 153) | public abstract <R, S> S traverseForestMulti(float[] point, IMultiVisi...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/executor/AbstractForestUpdateExecutor.java
  class AbstractForestUpdateExecutor (line 34) | @Getter
    method AbstractForestUpdateExecutor (line 49) | protected AbstractForestUpdateExecutor(IStateCoordinator<PointReferenc...
    method update (line 62) | public void update(Point point) {
    method update (line 66) | public void update(Point point, boolean updateShingleOnly) {
    method update (line 75) | public void update(Point point, long sequenceNumber) {
    method update (line 79) | public void update(Point point, long sequenceNumber, boolean updateShi...
    method updateInternal (line 97) | protected abstract List<UpdateResult<PointReference>> updateInternal(P...
    method setCurrentlySampling (line 99) | public void setCurrentlySampling(boolean value) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/executor/AbstractUpdateCoordinator.java
  class AbstractUpdateCoordinator (line 31) | public abstract class AbstractUpdateCoordinator<PointReference, Point>
    method AbstractUpdateCoordinator (line 37) | public AbstractUpdateCoordinator() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/executor/IStateCoordinator.java
  type IStateCoordinator (line 31) | public interface IStateCoordinator<PointReference, Point> {
    method initUpdate (line 45) | PointReference initUpdate(Point point, long sequenceNumber, boolean up...
    method completeUpdate (line 57) | void completeUpdate(List<UpdateResult<PointReference>> updateResults, ...
    method getTotalUpdates (line 59) | long getTotalUpdates();
    method setTotalUpdates (line 61) | void setTotalUpdates(long totalUpdates);
    method getStore (line 63) | IPointStore<PointReference, Point> getStore();

FILE: Java/core/src/main/java/com/amazon/randomcutforest/executor/ITraversable.java
  type ITraversable (line 27) | public interface ITraversable {
    method traverse (line 45) | <R> R traverse(float[] point, IVisitorFactory<R> visitorFactory);
    method traverseMulti (line 68) | <R> R traverseMulti(float[] point, IMultiVisitorFactory<R> visitorFact...
    method isOutputReady (line 81) | boolean isOutputReady();

FILE: Java/core/src/main/java/com/amazon/randomcutforest/executor/IUpdatable.java
  type IUpdatable (line 18) | public interface IUpdatable<PointReference> {
    method update (line 27) | UpdateResult<PointReference> update(PointReference point, long seqNum);

FILE: Java/core/src/main/java/com/amazon/randomcutforest/executor/ParallelForestTraversalExecutor.java
  class ParallelForestTraversalExecutor (line 35) | public class ParallelForestTraversalExecutor extends AbstractForestTrave...
    method ParallelForestTraversalExecutor (line 40) | public ParallelForestTraversalExecutor(ComponentList<?, ?> treeExecuto...
    method traverseForest (line 46) | @Override
    method traverseForest (line 55) | @Override
    method traverseForest (line 62) | @Override
    method traverseForestMulti (line 82) | @Override
    method traverseForestMulti (line 91) | @Override
    method submitAndJoin (line 99) | <T> T submitAndJoin(Callable<T> callable) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/executor/ParallelForestUpdateExecutor.java
  class ParallelForestUpdateExecutor (line 32) | public class ParallelForestUpdateExecutor<PointReference, Point>
    method ParallelForestUpdateExecutor (line 38) | public ParallelForestUpdateExecutor(IStateCoordinator<PointReference, ...
    method updateInternal (line 45) | @Override
    method submitAndJoin (line 51) | <T> T submitAndJoin(Callable<T> callable) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/executor/PointStoreCoordinator.java
  class PointStoreCoordinator (line 31) | public class PointStoreCoordinator<Point> extends AbstractUpdateCoordina...
    method PointStoreCoordinator (line 35) | public PointStoreCoordinator(IPointStore<Integer, Point> store) {
    method initUpdate (line 40) | @Override
    method completeUpdate (line 46) | @Override
    method getStore (line 58) | public IPointStore<Integer, Point> getStore() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/executor/SamplerPlusTree.java
  class SamplerPlusTree (line 41) | @Getter
    method SamplerPlusTree (line 55) | public SamplerPlusTree(IStreamSampler<P> sampler, ITree<P, Q> tree) {
    method update (line 79) | @Override
    method traverse (line 99) | @Override
    method traverseMulti (line 104) | @Override
    method setConfig (line 109) | @Override
    method getConfig (line 120) | @Override
    method isOutputReady (line 132) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/executor/SequentialForestTraversalExecutor.java
  class SequentialForestTraversalExecutor (line 31) | public class SequentialForestTraversalExecutor extends AbstractForestTra...
    method SequentialForestTraversalExecutor (line 33) | public SequentialForestTraversalExecutor(ComponentList<?, ?> component...
    method traverseForest (line 37) | @Override
    method traverseForest (line 47) | @Override
    method traverseForest (line 53) | @Override
    method traverseForestMulti (line 67) | @Override
    method traverseForestMulti (line 77) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/executor/SequentialForestUpdateExecutor.java
  class SequentialForestUpdateExecutor (line 29) | public class SequentialForestUpdateExecutor<PointReference, Point>
    method SequentialForestUpdateExecutor (line 32) | public SequentialForestUpdateExecutor(IStateCoordinator<PointReference...
    method updateInternal (line 37) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/executor/UpdateResult.java
  class UpdateResult (line 31) | @Builder
    method noop (line 48) | public static <Q> UpdateResult<Q> noop() {
    method getAddedPoint (line 61) | public Optional<PointReference> getAddedPoint() {
    method getDeletedPoint (line 73) | public Optional<PointReference> getDeletedPoint() {
    method isStateChange (line 85) | public boolean isStateChange() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/imputation/ConditionalSampleSummarizer.java
  class ConditionalSampleSummarizer (line 30) | public class ConditionalSampleSummarizer {
    method ConditionalSampleSummarizer (line 73) | public ConditionalSampleSummarizer(int[] missingDimensions, float[] qu...
    method summarize (line 84) | public SampleSummary summarize(List<ConditionalTreeSample> alist) {
    method summarize (line 89) | public SampleSummary summarize(List<ConditionalTreeSample> alist, bool...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/imputation/ImputeVisitor.java
  class ImputeVisitor (line 37) | public class ImputeVisitor implements MultiVisitor<ConditionalTreeSample> {
    method ImputeVisitor (line 91) | public ImputeVisitor(float[] liftedPoint, float[] queryPoint, int[] li...
    method ImputeVisitor (line 116) | public ImputeVisitor(float[] queryPoint, int numberOfMissingIndices, i...
    method ImputeVisitor (line 128) | ImputeVisitor(ImputeVisitor original) {
    method accept (line 147) | public void accept(final INodeView node, final int depthOfNode) {
    method acceptLeaf (line 174) | @Override
    method getResult (line 210) | @Override
    method trigger (line 223) | @Override
    method getAnomalyRank (line 230) | protected double getAnomalyRank() {
    method getDistance (line 234) | protected double getDistance() {
    method newPartialCopy (line 241) | @Override
    method adjustedRank (line 246) | double adjustedRank() {
    method updateCombine (line 250) | protected boolean updateCombine(ImputeVisitor other) {
    method combine (line 261) | @Override
    method updateFrom (line 269) | protected void updateFrom(ImputeVisitor visitor) {
    method scoreSeen (line 278) | protected double scoreSeen(int depth, int mass) {
    method scoreUnseen (line 282) | protected double scoreUnseen(int depth, int mass) {
    method isConverged (line 286) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/inputtypes/Point.java
  class Point (line 23) | public class Point {
    method Point (line 31) | public Point(double[] input, long inputTimestamp) {
    method getCurrentInput (line 36) | public double[] getCurrentInput() {
    method getInputTimestamp (line 40) | public long getInputTimestamp() {
    method copyIfNotnull (line 44) | protected double[] copyIfNotnull(double[] array) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/inspect/NearNeighborVisitor.java
  class NearNeighborVisitor (line 30) | public class NearNeighborVisitor implements Visitor<Optional<Neighbor>> {
    method NearNeighborVisitor (line 43) | public NearNeighborVisitor(float[] queryPoint, double distanceThreshol...
    method NearNeighborVisitor (line 55) | public NearNeighborVisitor(float[] queryPoint) {
    method accept (line 66) | @Override
    method acceptLeaf (line 80) | @Override
    method getResult (line 102) | @Override
    method isConverged (line 107) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/interpolation/SimpleInterpolationVisitor.java
  class SimpleInterpolationVisitor (line 30) | public class SimpleInterpolationVisitor implements Visitor<Interpolation...
    method SimpleInterpolationVisitor (line 66) | public SimpleInterpolationVisitor(float[] pointToScore, int sampleSize...
    method getResult (line 84) | @Override
    method accept (line 89) | @Override
    method acceptLeaf (line 138) | @Override
    method updateForCompute (line 179) | void updateForCompute(IBoundingBoxView smallBox, IBoundingBoxView larg...
    method fieldExt (line 226) | double fieldExt(INodeView node, boolean centerOfMass, double thisMass,...
    method influenceExt (line 230) | double influenceExt(INodeView node, boolean centerOfMass, double thisM...
    method fieldPoint (line 234) | double fieldPoint(INodeView node, double thisMass, float[] thislocatio...
    method influencePoint (line 238) | double influencePoint(INodeView node, double thisMass, float[] thisloc...
    method selfField (line 242) | double selfField(INodeView leafNode, double mass) {
    method selfInfluence (line 246) | double selfInfluence(INodeView leafnode, double mass) {
    method isConverged (line 250) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/IPreprocessor.java
  type IPreprocessor (line 24) | public interface IPreprocessor {
    method isOutputReady (line 26) | boolean isOutputReady();
    method getShingleSize (line 28) | int getShingleSize();
    method getInputLength (line 30) | int getInputLength();
    method getLastShingledPoint (line 32) | float[] getLastShingledPoint();
    method getShift (line 34) | double[] getShift();
    method getScale (line 36) | double[] getScale();
    method getSmoothedDeviations (line 38) | double[] getSmoothedDeviations();
    method getInternalTimeStamp (line 40) | int getInternalTimeStamp();
    method getValuesSeen (line 42) | int getValuesSeen();
    method getImputationMethod (line 44) | ImputationMethod getImputationMethod();
    method dataQuality (line 46) | double dataQuality();
    method getScaledShingledInput (line 48) | float[] getScaledShingledInput(double[] point, long timestamp, int[] m...
    method invertInPlaceRecentSummaryBlock (line 50) | SampleSummary invertInPlaceRecentSummaryBlock(SampleSummary summary);
    method update (line 52) | void update(double[] point, float[] rcfPoint, long timestamp, int[] mi...
    method getExpectedValue (line 54) | double[] getExpectedValue(int relativeBlockIndex, double[] reference, ...
    method getShingledInput (line 56) | double[] getShingledInput(int index);
    method getShingledInput (line 58) | double[] getShingledInput();
    method getDefaultFill (line 60) | double[] getDefaultFill();
    method setDefaultFill (line 62) | void setDefaultFill(double[] fill);
    method getTimeStamp (line 64) | long getTimeStamp(int index);
    method getTransformDecay (line 66) | double getTransformDecay();
    method numberOfImputes (line 68) | int numberOfImputes(long timestamp);
    method invertForecastRange (line 70) | TimedRangeVector invertForecastRange(RangeVector ranges, long lastTime...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/ImputePreprocessor.java
  class ImputePreprocessor (line 37) | @Getter
    method ImputePreprocessor (line 50) | public ImputePreprocessor(Builder<?> builder) {
    method getScaledShingledInput (line 55) | public float[] getScaledShingledInput(double[] inputPoint, long timest...
    method updateAllowed (line 91) | protected boolean updateAllowed() {
    method updateTimestamps (line 117) | @Override
    method updateForest (line 175) | void updateForest(boolean changeForest, double[] input, long timestamp...
    method update (line 201) | @Override
    method getTimeFactor (line 221) | protected double getTimeFactor(Deviation deviation) {
    method dischargeInitial (line 235) | protected void dischargeInitial(RandomCutForest forest) {
    method determineGap (line 300) | protected int determineGap(long timestampGap, double averageGap) {
    method numberOfImputes (line 309) | public int numberOfImputes(long timestamp) {
    method generateShingle (line 326) | protected float[] generateShingle(double[] inputTuple, long timestamp,...
    method basicImpute (line 407) | protected double[] basicImpute(double stepFraction, double[] previous,...
    method imputeRCF (line 434) | protected double[] imputeRCF(RandomCutForest forest, double[] partialI...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/InitialSegmentPreprocessor.java
  class InitialSegmentPreprocessor (line 31) | @Getter
    method InitialSegmentPreprocessor (line 35) | public InitialSegmentPreprocessor(Builder<?> builder) {
    method storeInitial (line 50) | protected void storeInitial(double[] inputPoint, long timestamp, int[]...
    method prepareInitialInput (line 73) | double prepareInitialInput() {
    method update (line 148) | @Override
    method getInitialDeviations (line 162) | protected Deviation[] getInitialDeviations() {
    method dischargeInitial (line 189) | protected void dischargeInitial(RandomCutForest forest) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/Preprocessor.java
  class Preprocessor (line 51) | @Getter
    method Preprocessor (line 166) | public Preprocessor(Builder<?> builder) {
    method manageDeviations (line 288) | void manageDeviations(Deviation[] deviationList, Optional<Deviation[]>...
    method requireInitialSegment (line 315) | public static boolean requireInitialSegment(boolean normalizeTime, Tra...
    method getScaledInput (line 323) | public float[] getScaledInput(double[] point, long timestamp) {
    method getScaledInput (line 331) | public float[] getScaledInput(float[] point, long timestamp) {
    method getScaledShingledInput (line 335) | public float[] getScaledShingledInput(double[] inputPoint, long timest...
    method getScale (line 385) | public double[] getScale() {
    method isOutputReady (line 400) | @Override
    method getShift (line 405) | public double[] getShift() {
    method getSmoothedDeviations (line 419) | public double[] getSmoothedDeviations() {
    method update (line 437) | public void update(double[] point, float[] rcfPoint, long timestamp, i...
    method dataQuality (line 455) | public double dataQuality() {
    method numberOfImputes (line 459) | public int numberOfImputes(long timestamp) {
    method inverseMapTime (line 472) | public long inverseMapTime(double gap, int relativePosition) {
    method inverseMapTimeValue (line 479) | protected long inverseMapTimeValue(double gap, long timestamp) {
    method getShingledInput (line 500) | public double[] getShingledInput(int index) {
    method getShingledInput (line 507) | @Override
    method getExpectedValue (line 528) | public double[] getExpectedValue(int relativeBlockIndex, double[] refe...
    method getExpectedBlock (line 549) | protected float[] getExpectedBlock(float[] newPoint, int relativeBlock...
    method invertInPlace (line 567) | protected void invertInPlace(float[] values, double[] previous, int re...
    method invertInPlaceRecentSummaryBlock (line 576) | public SampleSummary invertInPlaceRecentSummaryBlock(SampleSummary sum...
    method invertForecastRange (line 596) | public TimedRangeVector invertForecastRange(RangeVector ranges, long l...
    method getScaledInput (line 673) | protected float[] getScaledInput(double[] input, long timestamp, Devia...
    method updateShingle (line 690) | protected void updateShingle(double[] inputPoint, float[] scaledPoint) {
    method updateTimestamps (line 710) | protected void updateTimestamps(long timestamp) {
    method updateTimeStampDeviations (line 718) | protected void updateTimeStampDeviations(long timestamp, long previous) {
    method getTimeScale (line 728) | double getTimeScale() {
    method getTimeGapDifference (line 732) | double getTimeGapDifference() {
    method getTimeShift (line 736) | double getTimeShift() {
    method getTimeDrift (line 740) | double getTimeDrift() {
    method updateState (line 753) | protected void updateState(double[] inputPoint, float[] scaledInput, l...
    method copyAtEnd (line 770) | public static void copyAtEnd(double[] array, double[] small) {
    method copyAtEnd (line 775) | public static void copyAtEnd(float[] array, float[] small) {
    method copyIfNotnull (line 781) | protected static double[] copyIfNotnull(double[] array) {
    method copyIfNotnull (line 785) | protected static float[] copyIfNotnull(float[] array) {
    method shiftLeft (line 790) | public static void shiftLeft(double[] array, int baseDimension) {
    method shiftLeft (line 796) | public static void shiftLeft(float[] array, int baseDimension) {
    method normalize (line 807) | protected double normalize(double value, double factor) {
    method augmentTime (line 832) | protected float[] augmentTime(float[] normalized, long timestamp, doub...
    method getInitialTimeStamps (line 846) | public long[] getInitialTimeStamps() {
    method setInitialTimeStamps (line 851) | public void setInitialTimeStamps(long[] values) {
    method getInitialValues (line 856) | public double[][] getInitialValues() {
    method setInitialValues (line 869) | public void setInitialValues(double[][] values) {
    method getLastShingledInput (line 881) | public double[] getLastShingledInput() {
    method setLastShingledInput (line 886) | public void setLastShingledInput(double[] point) {
    method setPreviousTimeStamps (line 891) | public void setPreviousTimeStamps(long[] values) {
    method getTimeStampDeviations (line 903) | public Deviation[] getTimeStampDeviations() {
    method getPreviousTimeStamps (line 908) | public long[] getPreviousTimeStamps() {
    method getDeviationList (line 912) | public Deviation[] getDeviationList() {
    method getTransformDecay (line 916) | public double getTransformDecay() {
    method getWeights (line 924) | public double[] getWeights() {
    method getDefaultFill (line 933) | public double[] getDefaultFill() {
    method setDefaultFill (line 938) | public void setDefaultFill(double[] values) {
    method getTimeStamp (line 944) | public long getTimeStamp(int index) {
    method builder (line 951) | public static Builder<?> builder() {
    class Builder (line 955) | public static class Builder<T extends Builder<T>> {
      method build (line 983) | public Preprocessor build() {
      method dimensions (line 992) | public T dimensions(int dimensions) {
      method inputLength (line 997) | public T inputLength(int inputLength) {
      method startNormalization (line 1002) | public T startNormalization(int startNormalization) {
      method stopNormalization (line 1007) | public T stopNormalization(Integer stopNormalization) {
      method shingleSize (line 1012) | public T shingleSize(int shingleSize) {
      method transformDecay (line 1017) | public T transformDecay(double transformDecay) {
      method useImputedFraction (line 1022) | public T useImputedFraction(double fraction) {
      method randomSeed (line 1027) | public T randomSeed(long randomSeed) {
      method imputationMethod (line 1032) | public T imputationMethod(ImputationMethod imputationMethod) {
      method fillValues (line 1037) | public T fillValues(double[] values) {
      method weights (line 1043) | public T weights(double[] values) {
      method weightTime (line 1049) | public T weightTime(double value) {
      method normalizeTime (line 1054) | public T normalizeTime(boolean normalizeTime) {
      method transformMethod (line 1059) | public T transformMethod(TransformMethod method) {
      method forestMode (line 1064) | public T forestMode(ForestMode forestMode) {
      method deviations (line 1070) | public T deviations(Deviation[] deviations) {
      method dataQuality (line 1076) | public T dataQuality(Deviation[] dataQuality) {
      method timeDeviations (line 1082) | public T timeDeviations(Deviation[] timeDeviations) {
      method initialShingledInput (line 1087) | public T initialShingledInput(double[] initialShingledInput) {
      method initialPoint (line 1092) | public T initialPoint(float[] initialPoint) {
      method fastForward (line 1097) | public T fastForward(boolean fastForward) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/transform/DifferenceTransformer.java
  class DifferenceTransformer (line 28) | @Getter
    method DifferenceTransformer (line 32) | public DifferenceTransformer(double[] weights, Deviation[] deviation) {
    method invertInPlace (line 36) | @Override
    method invertForecastRange (line 56) | @Override
    method transformValues (line 73) | @Override
    method getShift (line 84) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/transform/ITransformer.java
  type ITransformer (line 32) | public interface ITransformer {
    method getWeights (line 41) | double[] getWeights();
    method setWeights (line 45) | void setWeights(double[] weights);
    method getDeviations (line 50) | Deviation[] getDeviations();
    method invertInPlace (line 57) | void invertInPlace(float[] values, double[] previousInput);
    method invertForecastRange (line 65) | void invertForecastRange(RangeVector ranges, int baseDimension, double...
    method updateDeviation (line 72) | void updateDeviation(double[] inputPoint, double[] previousInput, int[...
    method transformValues (line 80) | float[] transformValues(int internalTimeStamp, double[] inputPoint, do...
    method getShift (line 85) | double[] getShift(double[] previous);
    method getScale (line 89) | double[] getScale();
    method getSmoothedDeviations (line 92) | double[] getSmoothedDeviations();
    method getSmoothedDifferenceDeviations (line 95) | double[] getSmoothedDifferenceDeviations();

FILE: Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/transform/NormalizedDifferenceTransformer.java
  class NormalizedDifferenceTransformer (line 28) | @Getter
    method NormalizedDifferenceTransformer (line 32) | public NormalizedDifferenceTransformer(double[] weights, Deviation[] d...
    method invertInPlace (line 36) | @Override
    method invertForecastRange (line 57) | @Override
    method transformValues (line 89) | @Override
    method getShift (line 99) | @Override
    method getShift (line 108) | @Override
    method getScale (line 113) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/transform/NormalizedTransformer.java
  class NormalizedTransformer (line 23) | @Getter
    method NormalizedTransformer (line 27) | public NormalizedTransformer(double[] weights, Deviation[] deviation) {
    method clipValue (line 31) | protected double clipValue(double clipfactor) {
    method getScale (line 35) | protected double getScale(int i, Deviation[] devs) {
    method getShift (line 39) | protected double getShift(int i, Deviation[] devs) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/transform/SubtractMATransformer.java
  class SubtractMATransformer (line 23) | @Getter
    method SubtractMATransformer (line 27) | public SubtractMATransformer(double[] weights, Deviation[] deviations) {
    method getShift (line 31) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/transform/WeightedTransformer.java
  class WeightedTransformer (line 42) | @Getter
    method WeightedTransformer (line 52) | public WeightedTransformer(double[] weights, Deviation[] deviations) {
    method invertInPlace (line 69) | @Override
    method invertForecastRange (line 91) | public void invertForecastRange(RangeVector ranges, int baseDimension,...
    method updateDeviation (line 114) | public void updateDeviation(double[] inputPoint, double[] previousInpu...
    method normalize (line 149) | protected double normalize(double value, double shift, double scale, d...
    method transformValues (line 173) | @Override
    method clipValue (line 185) | protected double clipValue(double clipfactor) {
    method getDeviations (line 189) | public Deviation[] getDeviations() {
    method getWeights (line 197) | public double[] getWeights() {
    method setWeights (line 201) | public void setWeights(double[] weights) {
    method getScale (line 206) | protected double getScale(int i, Deviation[] devs) {
    method getShift (line 210) | protected double getShift(int i, Deviation[] devs) {
    method getDrift (line 214) | protected double getDrift(int i, Deviation[] devs) {
    method getScale (line 218) | @Override
    method getShift (line 227) | @Override
    method getSmoothedDeviations (line 236) | public double[] getSmoothedDeviations() {
    method getSmoothedDifferenceDeviations (line 244) | public double[] getSmoothedDifferenceDeviations() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/returntypes/ConditionalTreeSample.java
  class ConditionalTreeSample (line 25) | public class ConditionalTreeSample {
    method ConditionalTreeSample (line 60) | public ConditionalTreeSample(int pointStoreIndex, BoundingBox box, dou...
    method dedup (line 77) | public static List<ConditionalTreeSample> dedup(List<ConditionalTreeSa...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/returntypes/ConvergingAccumulator.java
  type ConvergingAccumulator (line 26) | public interface ConvergingAccumulator<R> {
    method accept (line 33) | void accept(R value);
    method isConverged (line 39) | boolean isConverged();
    method getValuesAccepted (line 44) | int getValuesAccepted();
    method getAccumulatedValue (line 49) | R getAccumulatedValue();

FILE: Java/core/src/main/java/com/amazon/randomcutforest/returntypes/DensityOutput.java
  class DensityOutput (line 22) | public class DensityOutput extends InterpolationMeasure {
    method DensityOutput (line 37) | public DensityOutput(int dimensions, int sampleSize) {
    method DensityOutput (line 46) | public DensityOutput(InterpolationMeasure base) {
    method getDensity (line 61) | public double getDensity(double q, int manifoldDimension) {
    method getDensity (line 87) | public double getDensity() {
    method getDirectionalDensity (line 102) | public DiVector getDirectionalDensity(double q, int manifoldDimension) {
    method getDirectionalDensity (line 120) | public DiVector getDirectionalDensity() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/returntypes/DiVector.java
  class DiVector (line 34) | public class DiVector {
    method DiVector (line 52) | public DiVector(int dimensions) {
    method DiVector (line 66) | public DiVector(double[] high, double[] low) {
    method DiVector (line 78) | public DiVector(DiVector base) {
    method addToLeft (line 97) | public static DiVector addToLeft(DiVector left, DiVector right) {
    method getDimensions (line 113) | public int getDimensions() {
    method scale (line 125) | public DiVector scale(double z) {
    method renormalize (line 141) | public void renormalize(double targetNorm) {
    method componentwiseTransform (line 159) | public void componentwiseTransform(Function<Double, Double> function) {
    method getHighLowSum (line 172) | public double getHighLowSum(int i) {
    method getHighLowSum (line 179) | public double getHighLowSum() {
    method lift (line 187) | public DiVector lift(Function<double[], double[]> projection) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/returntypes/InterpolationMeasure.java
  class InterpolationMeasure (line 30) | public class InterpolationMeasure {
    method InterpolationMeasure (line 46) | public InterpolationMeasure(int dimensions, int sampleSize) {
    method InterpolationMeasure (line 60) | public InterpolationMeasure(InterpolationMeasure base) {
    method InterpolationMeasure (line 68) | protected InterpolationMeasure(int sampleSize, DiVector measure, DiVec...
    method addToLeft (line 96) | public static InterpolationMeasure addToLeft(InterpolationMeasure left...
    method collector (line 120) | public static Collector<InterpolationMeasure, InterpolationMeasure, In...
    method getDimensions (line 129) | public int getDimensions() {
    method getSampleSize (line 136) | public int getSampleSize() {
    method scale (line 147) | public InterpolationMeasure scale(double z) {
    method lift (line 152) | public InterpolationMeasure lift(Function<double[], double[]> projecti...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/returntypes/Neighbor.java
  class Neighbor (line 40) | public class Neighbor {
    method Neighbor (line 72) | public Neighbor(float[] point, double distance, List<Long> sequenceInd...
    method Neighbor (line 79) | public Neighbor(float[] point, double distance, List<Long> sequenceInd...
    method collector (line 89) | public static Collector<Optional<Neighbor>, Map<Integer, Neighbor>, Li...
    method mergeSequenceIndexes (line 98) | private void mergeSequenceIndexes(Neighbor other) {
    method getHashCodeForPoint (line 108) | private int getHashCodeForPoint() {
    class CollectorImpl (line 112) | private static class CollectorImpl
      method supplier (line 115) | @Override
      method accumulator (line 120) | @Override
      method combiner (line 129) | @Override
      method finisher (line 137) | @Override
      method characteristics (line 151) | @Override
      method mergeNeighborIfNeededAndPut (line 156) | private void mergeNeighborIfNeededAndPut(Map<Integer, Neighbor> neig...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/returntypes/OneSidedConvergingDiVectorAccumulator.java
  class OneSidedConvergingDiVectorAccumulator (line 24) | public class OneSidedConvergingDiVectorAccumulator extends OneSidedStDev...
    method OneSidedConvergingDiVectorAccumulator (line 44) | public OneSidedConvergingDiVectorAccumulator(int dimensions, boolean h...
    method getConvergingValue (line 56) | @Override
    method accumulateValue (line 66) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/returntypes/OneSidedConvergingDoubleAccumulator.java
  class OneSidedConvergingDoubleAccumulator (line 23) | public class OneSidedConvergingDoubleAccumulator extends OneSidedStDevAc...
    method OneSidedConvergingDoubleAccumulator (line 41) | public OneSidedConvergingDoubleAccumulator(boolean highIsCritical, dou...
    method getConvergingValue (line 54) | @Override
    method accumulateValue (line 64) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/returntypes/OneSidedStDevAccumulator.java
  class OneSidedStDevAccumulator (line 33) | public abstract class OneSidedStDevAccumulator<R> implements ConvergingA...
    method OneSidedStDevAccumulator (line 99) | public OneSidedStDevAccumulator(boolean highIsCritical, double precisi...
    method accept (line 119) | @Override
    method getValuesAccepted (line 140) | @Override
    method isConverged (line 148) | @Override
    method getAccumulatedValue (line 156) | @Override
    method getConvergingValue (line 167) | protected abstract double getConvergingValue(R result);
    method accumulateValue (line 174) | protected abstract void accumulateValue(R result);
    method getWitnesses (line 179) | public int getWitnesses() {
    method getMean (line 186) | public double getMean() {
    method getDeviation (line 196) | public double getDeviation() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/returntypes/RangeVector.java
  class RangeVector (line 28) | public class RangeVector {
    method RangeVector (line 41) | public RangeVector(int dimensions) {
    method RangeVector (line 55) | public RangeVector(float[] values, float[] upper, float[] lower) {
    method RangeVector (line 66) | public RangeVector(float[] values) {
    method RangeVector (line 78) | public RangeVector(RangeVector base) {
    method shift (line 85) | public void shift(int i, float shift) {
    method scale (line 93) | public void scale(int i, float weight) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/returntypes/SampleSummary.java
  class SampleSummary (line 31) | public class SampleSummary {
    method SampleSummary (line 80) | public SampleSummary(int dimensions) {
    method SampleSummary (line 95) | public SampleSummary(float[] point) {
    method SampleSummary (line 99) | public SampleSummary(double[] point, float weight) {
    method addTypical (line 111) | void addTypical(float[][] summaryPoints, float[] relativeWeight, float...
    method SampleSummary (line 128) | public SampleSummary(List<Weighted<float[]>> points, SampleSummary clu...
    method SampleSummary (line 133) | public SampleSummary(List<Weighted<float[]>> points, float[][] summary...
    method SampleSummary (line 151) | public SampleSummary(List<Weighted<float[]>> points, float[][] summary...
    method SampleSummary (line 156) | public SampleSummary(List<Weighted<float[]>> points) {
    method SampleSummary (line 168) | public SampleSummary(List<Weighted<float[]>> points, double percentile) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/returntypes/TimedRangeVector.java
  class TimedRangeVector (line 35) | public class TimedRangeVector {
    method TimedRangeVector (line 45) | public TimedRangeVector(int dimensions, int horizon) {
    method TimedRangeVector (line 55) | public TimedRangeVector(RangeVector rangeVector, long[] timestamps, lo...
    method TimedRangeVector (line 71) | public TimedRangeVector(TimedRangeVector base) {
    method TimedRangeVector (line 83) | public TimedRangeVector(RangeVector base, int horizon) {
    method shiftTime (line 91) | public void shiftTime(int i, long shift) {
    method scaleTime (line 99) | public void scaleTime(int i, double weight) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/runner/AnomalyAttributionRunner.java
  class AnomalyAttributionRunner (line 35) | public class AnomalyAttributionRunner extends SimpleRunner {
    method AnomalyAttributionRunner (line 37) | public AnomalyAttributionRunner() {
    method main (line 43) | public static void main(String... args) throws IOException {
    class AnomalyAttributionTransformer (line 52) | public static class AnomalyAttributionTransformer implements LineTrans...
      method AnomalyAttributionTransformer (line 55) | public AnomalyAttributionTransformer(RandomCutForest forest) {
      method getResultValues (line 59) | @Override
      method getEmptyResultValue (line 73) | @Override
      method getResultColumnNames (line 82) | @Override
      method getForest (line 93) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/runner/AnomalyScoreRunner.java
  class AnomalyScoreRunner (line 34) | public class AnomalyScoreRunner extends SimpleRunner {
    method AnomalyScoreRunner (line 36) | public AnomalyScoreRunner() {
    method main (line 42) | public static void main(String... args) throws IOException {
    class AnomalyScoreTransformer (line 51) | public static class AnomalyScoreTransformer implements LineTransformer {
      method AnomalyScoreTransformer (line 54) | public AnomalyScoreTransformer(RandomCutForest forest) {
      method getResultValues (line 58) | @Override
      method getEmptyResultValue (line 65) | @Override
      method getResultColumnNames (line 70) | @Override
      method getForest (line 75) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/runner/ArgumentParser.java
  class ArgumentParser (line 29) | public class ArgumentParser {
    method ArgumentParser (line 54) | public ArgumentParser(String runnerClass, String runnerDescription) {
    method addArgument (line 105) | protected void addArgument(Argument<?> argument) {
    method removeArgument (line 128) | protected void removeArgument(String longFlag) {
    method parse (line 141) | public void parse(String... arguments) {
    method printUsage (line 168) | public void printUsage() {
    method printUsageAndExit (line 190) | public void printUsageAndExit(String errorMessage, Object... formatObj...
    method getNumberOfTrees (line 199) | public int getNumberOfTrees() {
    method getSampleSize (line 206) | public int getSampleSize() {
    method getWindowSize (line 213) | public int getWindowSize() {
    method getTimeDecay (line 220) | public double getTimeDecay() {
    method getShingleSize (line 231) | public int getShingleSize() {
    method getShingleCyclic (line 238) | public boolean getShingleCyclic() {
    method getDelimiter (line 245) | public String getDelimiter() {
    method getHeaderRow (line 252) | public boolean getHeaderRow() {
    method getRandomSeed (line 259) | public int getRandomSeed() {
    class Argument (line 263) | public static class Argument<T> {
      method Argument (line 273) | public Argument(String shortFlag, String longFlag, String descriptio...
      method Argument (line 284) | public Argument(String shortFlag, String longFlag, String descriptio...
      method getShortFlag (line 290) | public String getShortFlag() {
      method getLongFlag (line 294) | public String getLongFlag() {
      method getDescription (line 298) | public String getDescription() {
      method getDefaultValue (line 302) | public T getDefaultValue() {
      method getHelpMessage (line 306) | public String getHelpMessage() {
      method parse (line 314) | public void parse(String string) {
      method getValue (line 319) | public T getValue() {
    class StringArgument (line 324) | public static class StringArgument extends Argument<String> {
      method StringArgument (line 325) | public StringArgument(String shortFlag, String longFlag, String desc...
      method StringArgument (line 330) | public StringArgument(String shortFlag, String longFlag, String desc...
    class BooleanArgument (line 335) | public static class BooleanArgument extends Argument<Boolean> {
      method BooleanArgument (line 336) | public BooleanArgument(String shortFlag, String longFlag, String des...
    class IntegerArgument (line 341) | public static class IntegerArgument extends Argument<Integer> {
      method IntegerArgument (line 342) | public IntegerArgument(String shortFlag, String longFlag, String des...
      method IntegerArgument (line 347) | public IntegerArgument(String shortFlag, String longFlag, String des...
    class DoubleArgument (line 352) | public static class DoubleArgument extends Argument<Double> {
      method DoubleArgument (line 353) | public DoubleArgument(String shortFlag, String longFlag, String desc...
      method DoubleArgument (line 358) | public DoubleArgument(String shortFlag, String longFlag, String desc...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/runner/ImputeRunner.java
  class ImputeRunner (line 35) | public class ImputeRunner extends SimpleRunner {
    method ImputeRunner (line 41) | public ImputeRunner() {
    method main (line 45) | public static void main(String... args) throws IOException {
    method prepareAlgorithm (line 54) | @Override
    method processLine (line 61) | @Override
    class ImputeArgumentParser (line 84) | public static class ImputeArgumentParser extends ArgumentParser {
      method ImputeArgumentParser (line 88) | public ImputeArgumentParser() {
      method getMissingValueMarker (line 101) | public String getMissingValueMarker() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/runner/LineTransformer.java
  type LineTransformer (line 26) | public interface LineTransformer {
    method getResultValues (line 36) | List<String> getResultValues(double[] point);
    method getEmptyResultValue (line 44) | List<String> getEmptyResultValue();
    method getResultColumnNames (line 49) | List<String> getResultColumnNames();
    method getForest (line 55) | RandomCutForest getForest();

FILE: Java/core/src/main/java/com/amazon/randomcutforest/runner/SimpleDensityRunner.java
  class SimpleDensityRunner (line 35) | public class SimpleDensityRunner extends SimpleRunner {
    method SimpleDensityRunner (line 37) | public SimpleDensityRunner() {
    method main (line 43) | public static void main(String... args) throws IOException {
    class SimpleDensityTransformer (line 52) | public static class SimpleDensityTransformer implements LineTransformer {
      method SimpleDensityTransformer (line 55) | public SimpleDensityTransformer(RandomCutForest forest) {
      method getResultValues (line 59) | @Override
      method getEmptyResultValue (line 72) | @Override
      method getResultColumnNames (line 81) | @Override
      method getForest (line 91) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/runner/SimpleRunner.java
  class SimpleRunner (line 34) | public class SimpleRunner {
    method SimpleRunner (line 54) | public SimpleRunner(String runnerClass, String runnerDescription,
    method SimpleRunner (line 67) | public SimpleRunner(ArgumentParser argumentParser,
    method parse (line 78) | public void parse(String... arguments) {
    method run (line 90) | public void run(BufferedReader in, PrintWriter out) throws IOException {
    method prepareAlgorithm (line 117) | protected void prepareAlgorithm(int dimensions) {
    method writeHeader (line 138) | protected void writeHeader(String[] values, PrintWriter out) {
    method processLine (line 154) | protected void processLine(String[] values, PrintWriter out) {
    method parsePoint (line 185) | protected void parsePoint(String[] stringValues) {
    method finish (line 197) | protected void finish(PrintWriter out) {
    method getPointSize (line 204) | protected int getPointSize() {
    method getShingleSize (line 211) | protected int getShingleSize() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/runner/UpdateOnlyTransformer.java
  class UpdateOnlyTransformer (line 27) | public class UpdateOnlyTransformer implements LineTransformer {
    method UpdateOnlyTransformer (line 31) | public UpdateOnlyTransformer(RandomCutForest forest) {
    method getResultValues (line 35) | @Override
    method getEmptyResultValue (line 41) | @Override
    method getResultColumnNames (line 46) | @Override
    method getForest (line 51) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/sampler/AbstractStreamSampler.java
  class AbstractStreamSampler (line 27) | public abstract class AbstractStreamSampler<P> implements IStreamSampler...
    method initialAcceptProbability (line 87) | protected double initialAcceptProbability(int currentSize) {
    method acceptPoint (line 110) | public boolean acceptPoint(long sequenceIndex) {
    method acceptPoint (line 114) | public abstract boolean acceptPoint(long sequenceIndex, float weight);
    method addPoint (line 116) | @Override
    method AbstractStreamSampler (line 119) | public AbstractStreamSampler(Builder<?> builder) {
    method computeWeight (line 147) | protected float computeWeight(long sequenceIndex, float sampleWeight) {
    method setTimeDecay (line 165) | public void setTimeDecay(double newTimeDecay) {
    method getTimeDecay (line 179) | public double getTimeDecay() {
    method getMaxSequenceIndex (line 183) | public long getMaxSequenceIndex() {
    method setMaxSequenceIndex (line 187) | public void setMaxSequenceIndex(long index) {
    method getMostRecentTimeDecayUpdate (line 191) | public long getMostRecentTimeDecayUpdate() {
    method setMostRecentTimeDecayUpdate (line 195) | public void setMostRecentTimeDecayUpdate(long index) {
    method setConfig (line 199) | @Override
    method getConfig (line 210) | @Override
    method getCapacity (line 225) | @Override
    method getInitialAcceptFraction (line 230) | public double getInitialAcceptFraction() {
    method getRandomSeed (line 234) | public long getRandomSeed() {
    class ReplayableRandom (line 238) | protected class ReplayableRandom {
      method ReplayableRandom (line 242) | ReplayableRandom(long randomSeed) {
      method ReplayableRandom (line 246) | ReplayableRandom(Random random) {
      method nextDouble (line 250) | public double nextDouble() {
    class Builder (line 260) | public static class Builder<T extends Builder<T>> {
      method capacity (line 273) | public T capacity(int capacity) {
      method randomSeed (line 278) | public T randomSeed(long seed) {
      method random (line 283) | public T random(Random random) {
      method maxSequenceIndex (line 288) | public T maxSequenceIndex(long maxSequenceIndex) {
      method mostRecentTimeDecayUpdate (line 293) | public T mostRecentTimeDecayUpdate(long sequenceIndexOfMostRecentTim...
      method initialAcceptFraction (line 298) | public T initialAcceptFraction(double initialAcceptFraction) {
      method timeDecay (line 303) | public T timeDecay(double timeDecay) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/sampler/AcceptPointState.java
  class AcceptPointState (line 28) | @Data

FILE: Java/core/src/main/java/com/amazon/randomcutforest/sampler/CompactSampler.java
  class CompactSampler (line 56) | public class CompactSampler extends AbstractStreamSampler<Integer> {
    method builder (line 96) | public static Builder<?> builder() {
    method uniformSampler (line 100) | public static CompactSampler uniformSampler(int sampleSize, long rando...
    method CompactSampler (line 105) | protected CompactSampler(Builder<?> builder) {
    method acceptPoint (line 142) | @Override
    method evictMax (line 165) | public void evictMax() {
    method swapDown (line 190) | private void swapDown(int startIndex, boolean validate) {
    method swapDown (line 209) | private void swapDown(int startIndex) {
    method reheap (line 213) | public void reheap(boolean validate) {
    method addPoint (line 219) | public void addPoint(Integer pointIndex, float weight, long sequenceIn...
    method addPoint (line 225) | @Override
    method getSample (line 256) | @Override
    method getWeightedSample (line 266) | public List<Weighted<Integer>> getWeightedSample() {
    method streamSample (line 270) | private Stream<Weighted<Integer>> streamSample() {
    method reset_weights (line 282) | private void reset_weights() {
    method getEvictedPoint (line 297) | public Optional<ISampled<Integer>> getEvictedPoint() {
    method size (line 304) | @Override
    method getWeightArray (line 309) | public float[] getWeightArray() {
    method getPointIndexArray (line 313) | public int[] getPointIndexArray() {
    method getSequenceIndexArray (line 317) | public long[] getSequenceIndexArray() {
    method isStoreSequenceIndexesEnabled (line 321) | public boolean isStoreSequenceIndexesEnabled() {
    method swapWeights (line 325) | private void swapWeights(int a, int b) {
    class Builder (line 341) | public static class Builder<T extends Builder<T>> extends AbstractStre...
      method size (line 353) | public T size(int size) {
      method weight (line 358) | public T weight(float[] weight) {
      method pointIndex (line 363) | public T pointIndex(int[] pointIndex) {
      method sequenceIndex (line 368) | public T sequenceIndex(long[] sequenceIndex) {
      method storeSequenceIndexesEnabled (line 373) | public T storeSequenceIndexesEnabled(boolean storeSequenceIndexesEna...
      method validateHeap (line 378) | public T validateHeap(boolean validateHeap) {
      method build (line 383) | public CompactSampler build() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/sampler/ISampled.java
  type ISampled (line 24) | public interface ISampled<P> {
    method getValue (line 30) | P getValue();
    method getSequenceIndex (line 37) | long getSequenceIndex();

FILE: Java/core/src/main/java/com/amazon/randomcutforest/sampler/IStreamSampler.java
  type IStreamSampler (line 50) | public interface IStreamSampler<P> extends IDynamicConfig {
    method update (line 63) | default boolean update(P point, long sequenceIndex) {
    method acceptPoint (line 87) | boolean acceptPoint(long sequenceIndex);
    method addPoint (line 99) | void addPoint(P point);
    method getSample (line 106) | List<ISampled<P>> getSample();
    method getEvictedPoint (line 114) | Optional<ISampled<P>> getEvictedPoint();
    method isReady (line 120) | default boolean isReady() {
    method isFull (line 127) | default boolean isFull() {
    method getCapacity (line 134) | int getCapacity();
    method size (line 139) | int size();
    method setMaxSequenceIndex (line 141) | void setMaxSequenceIndex(long maxSequenceIndex);

FILE: Java/core/src/main/java/com/amazon/randomcutforest/sampler/Weighted.java
  class Weighted (line 27) | @Data

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/ExecutionContext.java
  class ExecutionContext (line 22) | @Data

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/IContextualStateMapper.java
  type IContextualStateMapper (line 18) | public interface IContextualStateMapper<Model, State, ContextState> {
    method toState (line 19) | State toState(Model model);
    method toModel (line 21) | Model toModel(State state, ContextState contextState, long seed);
    method toModel (line 23) | default Model toModel(State state, ContextState contextState) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/IStateMapper.java
  type IStateMapper (line 18) | public interface IStateMapper<Model, State> {
    method toState (line 19) | State toState(Model model);
    method toModel (line 21) | Model toModel(State state, long seed);
    method toModel (line 23) | default Model toModel(State state) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/PredictiveRandomCutForestMapper.java
  class PredictiveRandomCutForestMapper (line 29) | @Getter
    method toModel (line 34) | @Override
    method toState (line 49) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/PredictiveRandomCutForestState.java
  class PredictiveRandomCutForestState (line 26) | @Data

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/RandomCutForestMapper.java
  class RandomCutForestMapper (line 55) | @Getter
    method toState (line 117) | @Override
    method toModel (line 209) | public RandomCutForest toModel(RandomCutForestState state, ExecutionCo...
    method toModel (line 284) | public RandomCutForest toModel(RandomCutForestState state, long seed) {
    method toModel (line 298) | public RandomCutForest toModel(RandomCutForestState state) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/RandomCutForestState.java
  class RandomCutForestState (line 33) | @Data

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/Version.java
  class Version (line 18) | public class Version {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/preprocessor/PreprocessorMapper.java
  class PreprocessorMapper (line 34) | @Getter
    method toModel (line 38) | @Override
    method toState (line 69) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/preprocessor/PreprocessorState.java
  class PreprocessorState (line 26) | @Data

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/returntypes/DiVectorMapper.java
  class DiVectorMapper (line 26) | @Getter
    method toModel (line 30) | @Override
    method toState (line 40) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/returntypes/DiVectorState.java
  class DiVectorState (line 35) | @Getter

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/sampler/CompactSamplerMapper.java
  class CompactSamplerMapper (line 27) | @Getter
    method toModel (line 44) | @Override
    method toState (line 68) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/sampler/CompactSamplerState.java
  class CompactSamplerState (line 28) | @Data

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/statistics/DeviationMapper.java
  class DeviationMapper (line 24) | @Getter
    method toModel (line 28) | @Override
    method toState (line 34) | @Override
    method getStates (line 45) | public static DeviationState[] getStates(Deviation[] list, DeviationMa...
    method getDeviations (line 56) | public static Deviation[] getDeviations(DeviationState[] states, Devia...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/statistics/DeviationState.java
  class DeviationState (line 22) | @Data

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/store/NodeStoreState.java
  class NodeStoreState (line 24) | @Data

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/store/PointStoreMapper.java
  class PointStoreMapper (line 34) | @Getter
    method toModel (line 45) | @Override
    method toState (line 93) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/store/PointStoreState.java
  class PointStoreState (line 30) | @Data

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/tree/AbstractNodeStoreMapper.java
  class AbstractNodeStoreMapper (line 32) | @Getter
    method toModel (line 39) | @Override
    method toState (line 60) | @Override
    method reverseBits (line 117) | protected static void reverseBits(int size, int[] leftIndex, int[] rig...
    method reorderNodesInBreadthFirstOrder (line 167) | public int reorderNodesInBreadthFirstOrder(int[] map, int[] leftIndex,...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/tree/CompactRandomCutTreeContext.java
  class CompactRandomCutTreeContext (line 23) | @Data

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/tree/CompactRandomCutTreeState.java
  class CompactRandomCutTreeState (line 26) | @Data

FILE: Java/core/src/main/java/com/amazon/randomcutforest/state/tree/RandomCutTreeMapper.java
  class RandomCutTreeMapper (line 28) | @Getter
    method toModel (line 33) | @Override
    method toState (line 64) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/statistics/Deviation.java
  class Deviation (line 24) | public class Deviation {
    method Deviation (line 36) | public Deviation() {
    method Deviation (line 40) | public Deviation(double discount) {
    method Deviation (line 45) | public Deviation(double discount, double weight, double sumSquared, do...
    method copy (line 53) | public Deviation copy() {
    method getMean (line 57) | public double getMean() {
    method update (line 61) | public void update(double score) {
    method getDeviation (line 69) | public double getDeviation() {
    method isEmpty (line 78) | public boolean isEmpty() {
    method getDiscount (line 82) | public double getDiscount() {
    method setDiscount (line 86) | public void setDiscount(double discount) {
    method getSum (line 92) | public double getSum() {
    method getSumSquared (line 96) | public double getSumSquared() {
    method getWeight (line 100) | public double getWeight() {
    method getCount (line 104) | public int getCount() {
    method setCount (line 108) | public void setCount(int count) {
    method reset (line 112) | public void reset() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/store/IPointStore.java
  type IPointStore (line 25) | public interface IPointStore<PointReference, Point> extends IPointStoreV...
    method add (line 39) | PointReference add(Point point, long sequenceNum, boolean updateShingl...
    method add (line 41) | default PointReference add(Point point, long sequenceNum) {
    method incrementRefCount (line 46) | int incrementRefCount(int index);
    method decrementRefCount (line 49) | int decrementRefCount(int index);

FILE: Java/core/src/main/java/com/amazon/randomcutforest/store/IPointStoreView.java
  type IPointStoreView (line 26) | public interface IPointStoreView<Point> {
    method getDimensions (line 28) | int getDimensions();
    method getCapacity (line 30) | int getCapacity();
    method getNumericVector (line 32) | float[] getNumericVector(int index);
    method getInternalShingle (line 34) | float[] getInternalShingle();
    method getNextSequenceIndex (line 36) | long getNextSequenceIndex();
    method transformToShingledPoint (line 38) | float[] transformToShingledPoint(Point input);
    method isInternalRotationEnabled (line 40) | boolean isInternalRotationEnabled();
    method isInternalShinglingEnabled (line 42) | boolean isInternalShinglingEnabled();
    method getShingleSize (line 44) | int getShingleSize();
    method transformIndices (line 46) | int[] transformIndices(int[] indexList);
    method toString (line 55) | String toString(int index);
    method summarize (line 79) | List<ICluster<float[]>> summarize(int maxAllowed, double shrinkage, in...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/store/IndexIntervalManager.java
  class IndexIntervalManager (line 30) | public class IndexIntervalManager {
    method IndexIntervalManager (line 37) | public IndexIntervalManager(int capacity) {
    method toBits (line 47) | static BitSet toBits(int[] refCount) {
    method IndexIntervalManager (line 58) | public IndexIntervalManager(int[] refCount, int capacity) {
    method IndexIntervalManager (line 62) | public IndexIntervalManager(int capacity, int length, BitSet bits) {
    method extendCapacity (line 101) | public void extendCapacity(int newCapacity) {
    method isEmpty (line 116) | public boolean isEmpty() {
    method getCapacity (line 123) | public int getCapacity() {
    method size (line 130) | public int size() {
    method takeIndex (line 143) | public int takeIndex() {
    method releaseIndex (line 160) | public void releaseIndex(int index) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/store/PointStore.java
  class PointStore (line 38) | public abstract class PointStore implements IPointStore<Integer, float[]> {
    method setInfeasiblePointstoreLocationIndex (line 106) | abstract void setInfeasiblePointstoreLocationIndex(int index);
    method extendLocationList (line 108) | abstract void extendLocationList(int newCapacity);
    method setLocation (line 110) | abstract void setLocation(int index, int location);
    method getLocation (line 112) | abstract int getLocation(int index);
    method decrementRefCount (line 122) | @Override
    method takeIndex (line 152) | int takeIndex() {
    method getAmountToWrite (line 167) | protected int getAmountToWrite(float[] tempPoint) {
    method add (line 197) | public int add(double[] point, long sequenceNum) {
    method add (line 201) | public Integer add(float[] point, long sequenceNum, boolean updateShin...
    method incrementRefCount (line 255) | public int incrementRefCount(int index) {
    method getDimensions (line 274) | @Override
    method getCapacity (line 282) | public int getCapacity() {
    method getIndexCapacity (line 289) | public int getIndexCapacity() {
    method getShingleSize (line 298) | public int getShingleSize() {
    method getCurrentStoreCapacity (line 308) | public int getCurrentStoreCapacity() {
    method getStore (line 317) | public float[] getStore() {
    method getRefCount (line 326) | public int[] getRefCount() {
    method getStartOfFreeSegment (line 343) | public int getStartOfFreeSegment() {
    method isInternalShinglingEnabled (line 352) | public boolean isInternalShinglingEnabled() {
    method getNextSequenceIndex (line 361) | public long getNextSequenceIndex() {
    method getInternalShingle (line 371) | public float[] getInternalShingle() {
    method locationListLength (line 381) | abstract int locationListLength();
    method alignBoundaries (line 383) | void alignBoundaries(int initial, int freshStart) {
    method compact (line 392) | public void compact() {
    method getRefCount (line 457) | public int getRefCount(int i) {
    method isInternalRotationEnabled (line 466) | @Override
    method size (line 475) | public abstract int size();
    method getLocationList (line 477) | public abstract int[] getLocationList();
    method transformToShingledPoint (line 485) | @Override
    method copyShingle (line 494) | private float[] copyShingle() {
    method constructShingleInPlace (line 515) | protected float[] constructShingleInPlace(float[] target, float[] poin...
    method transformIndices (line 540) | @Override
    class Builder (line 564) | public static class Builder<T extends Builder<T>> {
      method dimensions (line 586) | public T dimensions(int dimensions) {
      method capacity (line 592) | public T capacity(int capacity) {
      method initialSize (line 599) | public T initialSize(int initialPointStoreSize) {
      method shingleSize (line 605) | public T shingleSize(int shingleSize) {
      method internalShinglingEnabled (line 611) | public T internalShinglingEnabled(boolean internalShinglingEnabled) {
      method internalRotationEnabled (line 617) | public T internalRotationEnabled(boolean internalRotationEnabled) {
      method directLocationEnabled (line 622) | @Deprecated
      method dynamicResizingEnabled (line 627) | @Deprecated
      method currentStoreCapacity (line 634) | public T currentStoreCapacity(int currentStoreCapacity) {
      method indexCapacity (line 641) | public T indexCapacity(int indexCapacity) {
      method knownShingle (line 649) | public T knownShingle(double[] knownShingle) {
      method refCount (line 656) | public T refCount(int[] refCount) {
      method locationList (line 663) | public T locationList(int[] locationList) {
      method store (line 668) | public T store(float[] store) {
      method startOfFreeSegment (line 675) | public T startOfFreeSegment(int startOfFreeSegment) {
      method nextTimeStamp (line 682) | public T nextTimeStamp(long nextTimeStamp) {
      method build (line 687) | public PointStore build() {
    method PointStore (line 696) | public PointStore(PointStore.Builder builder) {
    method resizeStore (line 759) | void resizeStore() {
    method checkShingleAlignment (line 770) | boolean checkShingleAlignment(int location, float[] point) {
    method copyPoint (line 778) | void copyPoint(float[] point, int src, int location, int length) {
    method checkFeasible (line 784) | protected abstract void checkFeasible(int index);
    method getNumericVector (line 796) | @Override
    method toString (line 813) | public String toString(int index) {
    method copyTo (line 817) | void copyTo(int dest, int source, int length) {
    method builder (line 825) | public static Builder builder() {
    method summarize (line 850) | public List<ICluster<float[]>> summarize(int maxAllowed, double shrink...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/store/PointStoreLarge.java
  class PointStoreLarge (line 22) | public class PointStoreLarge extends PointStore {
    method setInfeasiblePointstoreLocationIndex (line 26) | void setInfeasiblePointstoreLocationIndex(int index) {
    method extendLocationList (line 30) | void extendLocationList(int newCapacity) {
    method setLocation (line 38) | void setLocation(int index, int location) {
    method getLocation (line 42) | int getLocation(int index) {
    method locationListLength (line 46) | int locationListLength() {
    method PointStoreLarge (line 50) | public PointStoreLarge(PointStore.Builder builder) {
    method size (line 60) | @Override
    method checkFeasible (line 71) | @Override
    method getLocationList (line 76) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/store/PointStoreSmall.java
  class PointStoreSmall (line 22) | public class PointStoreSmall extends PointStore {
    method setInfeasiblePointstoreLocationIndex (line 27) | void setInfeasiblePointstoreLocationIndex(int index) {
    method extendLocationList (line 31) | void extendLocationList(int newCapacity) {
    method setLocation (line 40) | void setLocation(int index, int location) {
    method getLocation (line 45) | int getLocation(int index) {
    method locationListLength (line 49) | int locationListLength() {
    method PointStoreSmall (line 53) | public PointStoreSmall(PointStore.Builder builder) {
    method PointStoreSmall (line 67) | public PointStoreSmall(int dimensions, int capacity) {
    method checkFeasible (line 71) | @Override
    method size (line 76) | @Override
    method getLocationList (line 87) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/store/StreamSampler.java
  class StreamSampler (line 40) | public class StreamSampler<P> {
    method builder (line 62) | public static Builder<?> builder() {
    method StreamSampler (line 66) | public StreamSampler(Builder<?> builder) {
    method sample (line 86) | protected boolean sample(P object, float weight) {
    method StreamSampler (line 112) | public StreamSampler(StreamSampler<P> first, StreamSampler<P> second, ...
    method isCurrentlySampling (line 163) | public boolean isCurrentlySampling() {
    method pauseSampling (line 167) | public void pauseSampling() {
    method resumeSampling (line 171) | public void resumeSampling() {
    method getObjectList (line 175) | public ArrayList<Weighted<P>> getObjectList() {
    method getCapacity (line 179) | public int getCapacity() {
    method getSequenceNumber (line 183) | public long getSequenceNumber() {
    method getEntriesSeen (line 187) | public long getEntriesSeen() {
    class Builder (line 191) | public static class Builder<T extends Builder<T>> {
      method capacity (line 199) | public T capacity(int capacity) {
      method randomSeed (line 204) | public T randomSeed(long seed) {
      method initialAcceptFraction (line 209) | public T initialAcceptFraction(double initialAcceptFraction) {
      method timeDecay (line 214) | public T timeDecay(double timeDecay) {
      method storeSequenceIndexesEnabled (line 219) | public T storeSequenceIndexesEnabled(boolean storeSequenceIndexesEna...
      method build (line 224) | public StreamSampler build() {
      method getTimeDecay (line 228) | public double getTimeDecay() {
      method getCapacity (line 232) | public int getCapacity() {
      method getRandomSeed (line 236) | public long getRandomSeed() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/summarization/Center.java
  class Center (line 33) | public class Center implements ICluster<float[]> {
    method Center (line 43) | Center(float[] coordinate, float weight) {
    method initialize (line 50) | public static Center initialize(float[] coordinate, float weight) {
    method addPoint (line 57) | public void addPoint(int index, float weight, double dist, float[] point,
    method reset (line 66) | public void reset() {
    method averageRadius (line 73) | public double averageRadius() {
    method extentMeasure (line 78) | public double extentMeasure() {
    method getWeight (line 82) | public double getWeight() {
    method recompute (line 89) | public double recompute(Function<Integer, float[]> getPoint, boolean a...
    method getAssignedPoints (line 128) | @Override
    method absorb (line 137) | public void absorb(ICluster<float[]> other, BiFunction<float[], float[...
    method distance (line 164) | public double distance(float[] point, BiFunction<float[], float[], Dou...
    method distance (line 170) | @Override
    method primaryRepresentative (line 175) | @Override
    method getRepresentatives (line 180) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/summarization/GenericMultiCenter.java
  class GenericMultiCenter (line 52) | public class GenericMultiCenter<R> implements ICluster<R> {
    method GenericMultiCenter (line 66) | GenericMultiCenter(R coordinate, float weight, double shrinkage, int n...
    method initialize (line 75) | public static <R> GenericMultiCenter<R> initialize(R coordinate, float...
    method addPoint (line 86) | public void addPoint(int index, float weight, double dist, R point, Bi...
    method reset (line 106) | public void reset() {
    method averageRadius (line 116) | public double averageRadius() {
    method extentMeasure (line 121) | public double extentMeasure() {
    method getWeight (line 125) | public double getWeight() {
    method recompute (line 131) | public double recompute(Function<Integer, R> getPoint, boolean flag, B...
    method absorb (line 136) | public void absorb(ICluster<R> other, BiFunction<R, R, Double> distanc...
    method distance (line 205) | @Override
    method distance (line 217) | @Override
    method getRepresentatives (line 233) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/summarization/ICluster.java
  type ICluster (line 37) | public interface ICluster<R> {
    method reset (line 40) | void reset();
    method averageRadius (line 42) | double averageRadius();
    method extentMeasure (line 46) | double extentMeasure();
    method getWeight (line 49) | double getWeight();
    method absorb (line 52) | void absorb(ICluster<R> other, BiFunction<R, R, Double> distance);
    method distance (line 55) | double distance(R point, BiFunction<R, R, Double> distance);
    method distance (line 58) | double distance(ICluster<R> other, BiFunction<R, R, Double> distance);
    method getRepresentatives (line 63) | List<Weighted<R>> getRepresentatives();
    method primaryRepresentative (line 73) | default R primaryRepresentative(BiFunction<R, R, Double> distance) {
    method getAssignedPoints (line 86) | default List<Weighted<Integer>> getAssignedPoints() {
    method recompute (line 105) | double recompute(Function<Integer, R> getPoint, boolean force, BiFunct...
    method addPoint (line 109) | void addPoint(int index, float weight, double dist, R point, BiFunctio...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/summarization/MultiCenter.java
  class MultiCenter (line 27) | public class MultiCenter extends GenericMultiCenter<float[]> {
    method MultiCenter (line 31) | MultiCenter(float[] coordinate, float weight, double shrinkage, int nu...
    method initialize (line 36) | public static MultiCenter initialize(float[] coordinate, float weight,...
    method addPoint (line 44) | public void addPoint(int index, float weight, double dist, float[] point,
    method reset (line 52) | public void reset() {
    method recompute (line 60) | public double recompute(Function<Integer, float[]> getPoint, boolean f...
    method getAssignedPoints (line 78) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/summarization/Summarizer.java
  class Summarizer (line 34) | public class Summarizer {
    method L1distance (line 55) | public static Double L1distance(float[] a, float[] b) {
    method L2distance (line 63) | public static Double L2distance(float[] a, float[] b) {
    method LInfinitydistance (line 72) | public static Double LInfinitydistance(float[] a, float[] b) {
    method assignAndRecompute (line 91) | public static <R> void assignAndRecompute(List<Weighted<Integer>> samp...
    method iterativeClustering (line 198) | public static <R> List<ICluster<R>> iterativeClustering(int maxAllowed...
    method summarize (line 350) | public static <R> List<ICluster<R>> summarize(List<Weighted<R>> points...
    method singleCentroidSummarize (line 380) | public static List<ICluster<float[]>> singleCentroidSummarize(List<Wei...
    method summarize (line 405) | public static SampleSummary summarize(List<Weighted<float[]>> points, ...
    method summarize (line 446) | public static SampleSummary summarize(List<Weighted<float[]>> points, ...
    method summarize (line 466) | public static SampleSummary summarize(float[][] points, int maxAllowed...
    method l2summarize (line 486) | public static SampleSummary l2summarize(List<Weighted<float[]>> points...
    method l2summarize (line 499) | public static SampleSummary l2summarize(float[][] points, int maxAllow...
    method multiSummarize (line 525) | public static <R> List<ICluster<R>> multiSummarize(List<R> points, int...
    method multiSummarizeWeighted (line 537) | public static <R> List<ICluster<R>> multiSummarizeWeighted(List<Weight...
    method multiSummarize (line 547) | public static <R> List<ICluster<R>> multiSummarize(R[] points, int max...
    method multiSummarize (line 562) | public static List<ICluster<float[]>> multiSummarize(float[][] points,...
    method multiSummarizeWeighted (line 572) | public static List<ICluster<float[]>> multiSummarizeWeighted(List<Weig...

FILE: Java/core/src/main/java/com/amazon/randomcutforest/tree/AbstractNodeStore.java
  class AbstractNodeStore (line 39) | public abstract class AbstractNodeStore {
    method AbstractNodeStore (line 55) | public AbstractNodeStore(AbstractNodeStore.Builder<?> builder) {
    method addNode (line 63) | protected abstract int addNode(Stack<int[]> pathToRoot, float[] point,...
    method isLeaf (line 66) | public boolean isLeaf(int index) {
    method isInternal (line 70) | public boolean isInternal(int index) {
    method assignInPartialTree (line 74) | public abstract void assignInPartialTree(int savedParent, float[] poin...
    method getLeftIndex (line 76) | public abstract int getLeftIndex(int index);
    method getRightIndex (line 78) | public abstract int getRightIndex(int index);
    method getParentIndex (line 80) | public abstract int getParentIndex(int index);
    method setRoot (line 82) | public abstract void setRoot(int index);
    method decreaseMassOfInternalNode (line 84) | protected abstract void decreaseMassOfInternalNode(int node);
    method increaseMassOfInternalNode (line 86) | protected abstract void increaseMassOfInternalNode(int node);
    method manageInternalNodesPartial (line 88) | protected void manageInternalNodesPartial(Stack<int[]> path) {
    method getPath (line 95) | public Stack<int[]> getPath(int root, float[] point, boolean verbose) {
    method deleteInternalNode (line 113) | public abstract void deleteInternalNode(int index);
    method getMass (line 115) | public abstract int getMass(int index);
    method leftOf (line 117) | protected boolean leftOf(float cutValue, int cutDimension, float[] poi...
    method leftOf (line 121) | public boolean leftOf(int node, float[] point) {
    method getSibling (line 126) | public int getSibling(int node, int parent) {
    method spliceEdge (line 134) | public abstract void spliceEdge(int parent, int node, int newNode);
    method replaceParentBySibling (line 136) | public abstract void replaceParentBySibling(int grandParent, int paren...
    method getCutDimension (line 138) | public abstract int getCutDimension(int index);
    method getCutValue (line 140) | public double getCutValue(int index) {
    method toLeft (line 144) | protected boolean toLeft(float[] point, int currentNodeOffset) {
    method getCutDimension (line 148) | public abstract int[] getCutDimension();
    method getRightIndex (line 150) | public abstract int[] getRightIndex();
    method getLeftIndex (line 152) | public abstract int[] getLeftIndex();
    method getCutValues (line 154) | public float[] getCutValues() {
    method getCapacity (line 158) | public int getCapacity() {
    method size (line 162) | public int size() {
    class Builder (line 170) | public static class Builder<T extends Builder<T>> {
      method capacity (line 181) | public T capacity(int capacity) {
      method dimension (line 186) | public T dimension(int dimension) {
      method useRoot (line 191) | public T useRoot(int root) {
      method leftIndex (line 196) | public T leftIndex(int[] leftIndex) {
      method rightIndex (line 201) | public T rightIndex(int[] rightIndex) {
      method cutDimension (line 206) | public T cutDimension(int[] cutDimension) {
      method cutValues (line 211) | public T cutValues(float[] cutValues) {
      method storeParent (line 216) | public T storeParent(boolean storeParent) {
      method build (line 221) | public AbstractNodeStore build() {
    method builder (line 244) | public static Builder builder() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/tree/BoundingBox.java
  class BoundingBox (line 27) | public class BoundingBox implements IBoundingBoxView {
    method BoundingBox (line 44) | public BoundingBox(float[] point) {
    method BoundingBox (line 57) | public BoundingBox(final float[] minValues, final float[] maxValues, d...
    method BoundingBox (line 63) | public BoundingBox(final float[] first, final float[] second) {
    method copy (line 76) | public BoundingBox copy() {
    method getMergedBox (line 81) | public BoundingBox getMergedBox(IBoundingBoxView otherBox) {
    method probabilityOfCut (line 94) | public double probabilityOfCut(float[] point) {
    method getMergedBox (line 111) | public BoundingBox getMergedBox(float[] point) {
    method getMaxValues (line 116) | public float[] getMaxValues() {
    method getMinValues (line 120) | public float[] getMinValues() {
    method addPoint (line 124) | public BoundingBox addPoint(float[] point) {
    method addBox (line 140) | public BoundingBox addBox(BoundingBox otherBox) {
    method getDimensions (line 155) | public int getDimensions() {
    method getRangeSum (line 162) | public double getRangeSum() {
    method getMaxValue (line 172) | public double getMaxValue(final int dimension) {
    method getMinValue (line 182) | public double getMinValue(final int dimension) {
    method contains (line 194) | public boolean contains(float[] point) {
    method contains (line 205) | public boolean contains(BoundingBox otherBox) {
    method getRange (line 210) | public double getRange(final int dimension) {
    method toString (line 214) | @Override
    method equals (line 228) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/tree/Cut.java
  class Cut (line 23) | public class Cut {
    method Cut (line 34) | public Cut(int dimension, double value) {
    method isLeftOf (line 52) | public static boolean isLeftOf(double[] point, Cut cut) {
    method getDimension (line 61) | public int getDimension() {
    method getValue (line 73) | public double getValue() {
    method toString (line 77) | @Override

FILE: Java/core/src/main/java/com/amazon/randomcutforest/tree/HyperTree.java
  class HyperTree (line 27) | public class HyperTree extends RandomCutTree {
    method getgVec (line 31) | public Function<IBoundingBoxView, double[]> getgVec() {
    method builder (line 35) | public static Builder builder() {
    method HyperTree (line 39) | protected HyperTree(HyperTree.Builder builder) {
    method makeTree (line 44) | public void makeTree(List<Integer> list, int seed) {
    method makeTreeInt (line 65) | private int makeTreeInt(List<Integer> pointList, int seed, int firstFree,
    method getCut (line 106) | private Cut getCut(IBoundingBoxView bb, Random ring, Function<IBoundin...
    class Builder (line 138) | public static class Builder extends RandomCutTree.Builder<Builder> {
      method buildGVec (line 141) | public Builder buildGVec(Function<IBoundingBoxView, double[]> gVec) {
      method build (line 146) | public HyperTree build() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/tree/IBoundingBoxView.java
  type IBoundingBoxView (line 18) | public interface IBoundingBoxView {
    method getRangeSum (line 20) | double getRangeSum();
    method getDimensions (line 22) | int getDimensions();
    method getRange (line 24) | double getRange(int i);
    method getMinValue (line 26) | double getMinValue(int i);
    method getMaxValue (line 28) | double getMaxValue(int i);
    method copy (line 31) | IBoundingBoxView copy();
    method getMergedBox (line 34) | IBoundingBoxView getMergedBox(float[] point);
    method getMergedBox (line 37) | IBoundingBoxView getMergedBox(IBoundingBoxView otherBox);

FILE: Java/core/src/main/java/com/amazon/randomcutforest/tree/INodeView.java
  type INodeView (line 20) | public interface INodeView {
    method isLeaf (line 22) | boolean isLeaf();
    method getMass (line 24) | int getMass();
    method getBoundingBox (line 26) | IBoundingBoxView getBoundingBox();
    method getSiblingBoundingBox (line 28) | IBoundingBoxView getSiblingBoundingBox(float[] point);
    method getCutDimension (line 30) | int getCutDimension();
    method getCutValue (line 32) | double getCutValue();
    method getLeafPoint (line 34) | float[] getLeafPoint();
    method getLiftedLeafPoint (line 36) | default float[] getLiftedLeafPoint() {
    method getSequenceIndexes (line 45) | HashMap<Long, Integer> getSequenceIndexes();
    method probailityOfSeparation (line 54) | double probailityOfSeparation(float[] point);
    method getLeafPointIndex (line 61) | int getLeafPointIndex();

FILE: Java/core/src/main/java/com/amazon/randomcutforest/tree/ITree.java
  type ITree (line 28) | public interface ITree<PointReference, Point> extends ITraversable, IDyn...
    method getMass (line 29) | int getMass();
    method projectToTree (line 31) | float[] projectToTree(float[] point);
    method liftFromTree (line 33) | float[] liftFromTree(float[] result);
    method liftFromTree (line 35) | double[] liftFromTree(double[] result);
    method projectMissingIndices (line 37) | int[] projectMissingIndices(int[] list);
    method addPoint (line 39) | PointReference addPoint(PointReference point, long sequenceIndex);
    method addPointToPartialTree (line 41) | void addPointToPartialTree(PointReference point, long sequenceIndex);
    method validateAndReconstruct (line 43) | void validateAndReconstruct();
    method deletePoint (line 45) | PointReference deletePoint(PointReference point, long sequenceIndex);
    method getRandomSeed (line 47) | long getRandomSeed();

FILE: Java/core/src/main/java/com/amazon/randomcutforest/tree/NodeStoreLarge.java
  class NodeStoreLarge (line 41) | public class NodeStoreLarge extends AbstractNodeStore {
    method NodeStoreLarge (line 49) | public NodeStoreLarge(AbstractNodeStore.Builder builder) {
    method addNode (line 93) | @Override
    method getLeftIndex (line 121) | public int getLeftIndex(int index) {
    method getRightIndex (line 125) | public int getRightIndex(int index) {
    method setRoot (line 129) | public void setRoot(int index) {
    method decreaseMassOfInternalNode (line 135) | @Override
    method increaseMassOfInternalNode (line 140) | @Override
    method deleteInternalNode (line 145) | public void deleteInternalNode(int index) {
    method getMass (line 154) | public int getMass(int index) {
    method assignInPartialTree (line 158) | @Override
    method spliceEdge (line 167) | public void spliceEdge(int parent, int node, int newNode) {
    method replaceParentBySibling (line 179) | public void replaceParentBySibling(int grandParent, int parent, int no...
    method getCutDimension (line 191) | public int getCutDimension(int index) {
    method getCutDimension (line 195) | public int[] getCutDimension() {
    method getLeftIndex (line 199) | public int[] getLeftIndex() {
    method getRightIndex (line 203) | public int[] getRightIndex() {
    method getParentIndex (line 207) | public int getParentIndex(int index) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/tree/NodeStoreMedium.java
  class NodeStoreMedium (line 42) | public class NodeStoreMedium extends AbstractNodeStore {
    method NodeStoreMedium (line 50) | public NodeStoreMedium(AbstractNodeStore.Builder builder) {
    method addNode (line 95) | @Override
    method assignInPartialTree (line 123) | @Override
    method getLeftIndex (line 132) | public int getLeftIndex(int index) {
    method getRightIndex (line 136) | public int getRightIndex(int index) {
    method getParentIndex (line 140) | public int getParentIndex(int index) {
    method setRoot (line 145) | public void setRoot(int index) {
    method decreaseMassOfInternalNode (line 151) | @Override
    method increaseMassOfInternalNode (line 156) | @Override
    method deleteInternalNode (line 162) | public void deleteInternalNode(int index) {
    method getMass (line 171) | public int getMass(int index) {
    method spliceEdge (line 175) | public void spliceEdge(int parent, int node, int newNode) {
    method replaceParentBySibling (line 187) | public void replaceParentBySibling(int grandParent, int parent, int no...
    method getCutDimension (line 199) | public int getCutDimension(int index) {
    method getCutDimension (line 203) | public int[] getCutDimension() {
    method getLeftIndex (line 207) | public int[] getLeftIndex() {
    method getRightIndex (line 211) | public int[] getRightIndex() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/tree/NodeStoreSmall.java
  class NodeStoreSmall (line 43) | public class NodeStoreSmall extends AbstractNodeStore {
    method NodeStoreSmall (line 51) | public NodeStoreSmall(AbstractNodeStore.Builder builder) {
    method addNode (line 99) | @Override
    method assignInPartialTree (line 127) | @Override
    method getLeftIndex (line 136) | public int getLeftIndex(int index) {
    method getRightIndex (line 140) | public int getRightIndex(int index) {
    method getParentIndex (line 144) | public int getParentIndex(int index) {
    method setRoot (line 149) | public void setRoot(int index) {
    method decreaseMassOfInternalNode (line 155) | @Override
    method increaseMassOfInternalNode (line 160) | @Override
    method deleteInternalNode (line 166) | public void deleteInternalNode(int index) {
    method getMass (line 175) | public int getMass(int index) {
    method spliceEdge (line 179) | public void spliceEdge(int parent, int node, int newNode) {
    method replaceParentBySibling (line 191) | public void replaceParentBySibling(int grandParent, int parent, int no...
    method getCutDimension (line 203) | public int getCutDimension(int index) {
    method getCutDimension (line 207) | public int[] getCutDimension() {
    method getLeftIndex (line 211) | public int[] getLeftIndex() {
    method getRightIndex (line 215) | public int[] getRightIndex() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/tree/NodeView.java
  class NodeView (line 24) | public class NodeView implements INodeView {
    method NodeView (line 33) | public NodeView(RandomCutTree tree, IPointStoreView<float[]> pointStor...
    method getMass (line 38) | public int getMass() {
    method getBoundingBox (line 42) | public IBoundingBoxView getBoundingBox() {
    method getSiblingBoundingBox (line 49) | public IBoundingBoxView getSiblingBoundingBox(float[] point) {
    method getCutDimension (line 54) | public int getCutDimension() {
    method getCutValue (line 58) | @Override
    method getLeafPoint (line 63) | public float[] getLeafPoint() {
    method getSequenceIndexes (line 67) | public HashMap<Long, Integer> getSequenceIndexes() {
    method probailityOfSeparation (line 76) | @Override
    method getLeafPointIndex (line 81) | @Override
    method isLeaf (line 86) | public boolean isLeaf() {
    method setCurrentNode (line 90) | protected void setCurrentNode(int newNode, int index, boolean setBox) {
    method setCurrentNodeOnly (line 98) | protected void setCurrentNodeOnly(int newNode) {
    method updateToParent (line 102) | public void updateToParent(int parent, int currentSibling, boolean upd...
    method toLeft (line 111) | protected boolean toLeft(float[] point) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/tree/RandomCutTree.java
  class RandomCutTree (line 56) | public class RandomCutTree implements ITree<Integer, float[]> {
    method RandomCutTree (line 81) | protected RandomCutTree(Builder<?> builder) {
    method setConfig (line 107) | @Override
    method getConfig (line 118) | @Override
    method setBoundingBoxCacheFraction (line 134) | public void setBoundingBoxCacheFraction(double fraction) {
    method randomCut (line 153) | protected Cut randomCut(double factor, float[] point, BoundingBox box) {
    method addPoint (line 251) | public Integer addPoint(Integer pointIndex, long sequenceIndex) {
    method manageAncestorsAdd (line 350) | protected void manageAncestorsAdd(Stack<int[]> path, float[] point) {
    method addPointToPartialTree (line 372) | public void addPointToPartialTree(Integer pointIndex, long sequenceInd...
    method deletePoint (line 403) | public Integer deletePoint(Integer pointIndex, long sequenceIndex) {
    method manageAncestorsDelete (line 446) | protected void manageAncestorsDelete(Stack<int[]> path, float[] point) {
    method isLeaf (line 462) | public boolean isLeaf(int index) {
    method isInternal (line 468) | public boolean isInternal(int index) {
    method convertToLeaf (line 474) | public int convertToLeaf(int pointIndex) {
    method getPointIndex (line 478) | public int getPointIndex(int index) {
    method getLeftChild (line 483) | public int getLeftChild(int index) {
    method getRightChild (line 488) | public int getRightChild(int index) {
    method getCutDimension (line 493) | public int getCutDimension(int index) {
    method getCutValue (line 498) | public double getCutValue(int index) {
    method getMass (line 505) | protected int getMass(int index) {
    method getLeafMass (line 509) | protected int getLeafMass(int index) {
    method increaseLeafMass (line 515) | protected void increaseLeafMass(int index) {
    method decreaseLeafMass (line 520) | protected int decreaseLeafMass(int index) {
    method getMass (line 535) | @Override
    method resizeCache (line 542) | public void resizeCache(double fraction) {
    method translate (line 555) | protected int translate(int index) {
    method copyBoxToData (line 563) | void copyBoxToData(int idx, BoundingBox box) {
    method addPointInPlace (line 571) | void addPointInPlace(int index, float[] point) {
    method getBox (line 590) | public BoundingBox getBox(int index) {
    method reconstructBox (line 612) | BoundingBox reconstructBox(int index, IPointStoreView<float[]> pointSt...
    method checkStrictlyContains (line 618) | boolean checkStrictlyContains(int index, float[] point) {
    method checkContainsAndRebuildBox (line 634) | boolean checkContainsAndRebuildBox(int index, float[] point, IPointSto...
    method getBoxFromData (line 647) | BoundingBox getBoxFromData(int idx) {
    method addBox (line 655) | void addBox(int index, float[] point, BoundingBox box) {
    method growNodeBox (line 663) | void growNodeBox(BoundingBox box, IPointStoreView<float[]> pointStoreV...
    method probabilityOfCut (line 689) | public double probabilityOfCut(int node, float[] point, BoundingBox ot...
    method getPointSum (line 718) | public float[] getPointSum(int index) {
    method invalidatePointSum (line 733) | public void invalidatePointSum(int index) {
    method recomputePointSum (line 739) | public void recomputePointSum(int index) {
    method getSequenceMap (line 747) | public HashMap<Long, Integer> getSequenceMap(int index) {
    method getSequenceList (line 756) | public List<Long> getSequenceList(int index) {
    method addLeaf (line 760) | protected void addLeaf(int pointIndex, long sequenceIndex) {
    method removeLeaf (line 771) | public void removeLeaf(int leafPointIndex, long sequenceIndex) {
    method validateAndReconstruct (line 784) | public void validateAndReconstruct() {
    method validateAndReconstruct (line 798) | public BoundingBox validateAndReconstruct(int index) {
    method traverse (line 844) | @Override
    method traversePathToLeafAndVisitNodes (line 855) | protected <R> void traversePathToLeafAndVisitNodes(float[] point, Visi...
    method traverseMulti (line 890) | @Override
    method traverseTreeMulti (line 901) | protected <R> void traverseTreeMulti(float[] point, MultiVisitor<R> vi...
    method getNumberOfLeaves (line 927) | public int getNumberOfLeaves() {
    method isCenterOfMassEnabled (line 931) | public boolean isCenterOfMassEnabled() {
    method isStoreSequenceIndexesEnabled (line 935) | public boolean isStoreSequenceIndexesEnabled() {
    method getBoundingBoxCacheFraction (line 939) | public double getBoundingBoxCacheFraction() {
    method getDimension (line 943) | public int getDimension() {
    method getRoot (line 952) | public Integer getRoot() {
    method getOutputAfter (line 960) | public int getOutputAfter() {
    method isOutputReady (line 964) | @Override
    method projectToTree (line 969) | public float[] projectToTree(float[] point) {
    method liftFromTree (line 973) | public float[] liftFromTree(float[] result) {
    method liftFromTree (line 977) | public double[] liftFromTree(double[] result) {
    method projectMissingIndices (line 981) | public int[] projectMissingIndices(int[] list) {
    method getRandomSeed (line 985) | public long getRandomSeed() {
    method getNodeStore (line 989) | public AbstractNodeStore getNodeStore() {
    class Builder (line 993) | public static class Builder<T extends Builder<T>> {
      method capacity (line 1007) | public T capacity(int capacity) {
      method boundingBoxCacheFraction (line 1012) | public T boundingBoxCacheFraction(double boundingBoxCacheFraction) {
      method pointStoreView (line 1017) | public T pointStoreView(IPointStoreView<float[]> pointStoreView) {
      method nodeStore (line 1022) | public T nodeStore(AbstractNodeStore nodeStore) {
      method randomSeed (line 1027) | public T randomSeed(long randomSeed) {
      method random (line 1032) | public T random(Random random) {
      method outputAfter (line 1037) | public T outputAfter(int outputAfter) {
      method dimension (line 1042) | public T dimension(int dimension) {
      method setRoot (line 1047) | public T setRoot(int root) {
      method storeParent (line 1052) | public T storeParent(boolean storeParent) {
      method storeSequenceIndexesEnabled (line 1057) | public T storeSequenceIndexesEnabled(boolean storeSequenceIndexesEna...
      method centerOfMassEnabled (line 1062) | public T centerOfMassEnabled(boolean centerOfMassEnabled) {
      method build (line 1067) | public RandomCutTree build() {
    method builder (line 1072) | public static Builder builder() {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/util/ArrayPacking.java
  class ArrayPacking (line 25) | public class ArrayPacking {
    method logMax (line 38) | public static int logMax(long base) {
    method pack (line 59) | public static int[] pack(int[] inputArray, boolean compress) {
    method pack (line 74) | public static int[] pack(int[] inputArray, int length, boolean compres...
    method pack (line 125) | public static int[] pack(short[] inputArray, boolean compress) {
    method pack (line 140) | public static int[] pack(short[] inputArray, int length, boolean compr...
    method unpackInts (line 195) | public static int[] unpackInts(int[] packedArray, boolean decompress) {
    method unpackInts (line 219) | public static int[] unpackInts(int[] packedArray, int length, boolean ...
    method copyToShort (line 252) | private static short[] copyToShort(int[] array, int length) {
    method unpackShorts (line 269) | public static short[] unpackShorts(int[] packedArray, boolean decompre...
    method unpackShorts (line 293) | public static short[] unpackShorts(int[] packedArray, int length, bool...
    method pack (line 332) | public static byte[] pack(double[] array) {
    method pack (line 345) | public static byte[] pack(double[] array, int length) {
    method pack (line 364) | public static byte[] pack(float[] array) {
    method pack (line 377) | public static byte[] pack(float[] array, int length) {
    method unpackDoubles (line 396) | public static double[] unpackDoubles(byte[] bytes) {
    method unpackDoubles (line 410) | public static double[] unpackDoubles(byte[] bytes, int length) {
    method unpackFloats (line 433) | public static float[] unpackFloats(byte[] bytes) {
    method unpackFloats (line 447) | public static float[] unpackFloats(byte[] bytes, int length) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/util/ArrayUtils.java
  class ArrayUtils (line 23) | public class ArrayUtils {
    method cleanCopy (line 32) | public static double[] cleanCopy(double[] point) {
    method cleanCopy (line 42) | public static float[] cleanCopy(float[] point) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/util/ShingleBuilder.java
  class ShingleBuilder (line 48) | public class ShingleBuilder {
    method ShingleBuilder (line 90) | public ShingleBuilder(int dimensions, int shingleSize, boolean cyclic) {
    method ShingleBuilder (line 110) | public ShingleBuilder(int dimensions, int shingleSize) {
    method isFull (line 117) | public boolean isFull() {
    method getInputPointSize (line 124) | public int getInputPointSize() {
    method getShingledPointSize (line 131) | public int getShingledPointSize() {
    method isCyclic (line 138) | public boolean isCyclic() {
    method getShingleIndex (line 150) | public int getShingleIndex() {
    method addPoint (line 159) | public void addPoint(double[] point) {
    method getShingle (line 173) | public double[] getShingle() {
    method getShingle (line 184) | public void getShingle(double[] shingle) {

FILE: Java/core/src/main/java/com/amazon/randomcutforest/util/Weighted.java
  class Weighted (line 29) | public class Weighted<Q> {
    method Weighted (line 34) | public Weighted(Q object, float weight) {
    method createSample (line 55) | public static <Q> List<Weighted<Q>> createSample(List<Weighted<Q>> inp...
    method prefixPick (line 98) | public static <Q> Weighted<Q> prefixPick(List<Weighted<Q>> points, dou...

FILE: Java/core/src/test/java/com/amazon/randomcutforest/AttributionExamplesFunctionalTest.java
  class AttributionExamplesFunctionalTest (line 29) | @Tag("functional")
    method RRCFattributionTest (line 48) | @Test
    method attributionUnMaskingTest (line 150) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/CPUTest.java
  class CPUTest (line 54) | @Tag("functional")
    method profileTestSync (line 70) | @Test
    method profileTestASync (line 111) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/ConditionalFieldTest.java
  class ConditionalFieldTest (line 28) | public class ConditionalFieldTest {
    method SimpleTest (line 46) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/DynamicPointSetFunctionalTest.java
  class DynamicPointSetFunctionalTest (line 33) | @Tag("functional")
    method rotateClockWise (line 52) | static double[] rotateClockWise(double[] point, double theta) {
    method movingDensity (line 59) | @Test
    method movingNeighbors (line 131) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/ForecastTest.java
  class ForecastTest (line 31) | @Tag("functional")
    method basic (line 34) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/MultiCenterTest.java
  class MultiCenterTest (line 45) | @Tag("functional")
    method constructorTest (line 56) | @Test
    method initializationTest (line 68) | @Test
    method SummaryTest (line 79) | @ParameterizedTest
    method MultiSummaryTestGeneric (line 107) | @ParameterizedTest
    method MultiSummaryTest (line 135) | @Test
    method ParallelTest (line 161) | @ParameterizedTest
    method StringTest (line 198) | @Test
    method toyDistance (line 224) | public static double toyDistance(String a, String b) {
    method getData (line 246) | public float[][] getData(int dataSize, int newDimensions, int seed, Bi...
    method getABString (line 285) | public String getABString(int size, double probabilityOfA, Random rand...
    method generateArguments (line 298) | private static Stream<Arguments> generateArguments() {

FILE: Java/core/src/test/java/com/amazon/randomcutforest/PredictiveRandomCutForestTest.java
  class PredictiveRandomCutForestTest (line 52) | public class PredictiveRandomCutForestTest {
    method testConfig (line 54) | @Test
    method simpleExample (line 89) | public void simpleExample(int dataSize, TransformMethod method, Forest...
    method configTest (line 142) | @Test
    method generateRecordKey (line 150) | float[] generateRecordKey(Random random) {
    method fillInValues (line 176) | void fillInValues(float[] record, Random random, NormalDistribution no...
    method testImpute (line 199) | @ParameterizedTest
    method timeAugmentedTest (line 266) | @ParameterizedTest

FILE: Java/core/src/test/java/com/amazon/randomcutforest/RandomCutForestBuilderTest.java
  class RandomCutForestBuilderTest (line 32) | public class RandomCutForestBuilderTest {
    method setUp (line 45) | @BeforeEach
    method testForestBuilderWithCustomArguments (line 61) | @Test
    method testDefaultForestWithDimensionArgument (line 74) | @Test
    method testDefaultForestWithDimensionAndRandomSeedArguments (line 86) | @Test
    method testDefaultForestWithCustomOutputAfterArgument (line 98) | @Test
    method testForestBuilderWithDefaultParallelExecutionThreadPoolSize (line 110) | @Test
    method testForestBuilderWithDefaultLambdaValue (line 126) | @Test
    method testIllegalExceptionIsThrownWhenNumberOfTreesIsZero (line 133) | @Test
    method testIllegalExceptionIsThrownWhenSampleSizeIsZero (line 139) | @Test
    method testIllegalExceptionIsThrownWhenOutputAfterIsNegative (line 145) | @Test
    method testIllegalExceptionIsNotThrownWhenOutputAfterIsGreaterThanSample (line 151) | @Test
    method testIllegalExceptionIsThrownWhenDimensionIsNotProvided (line 157) | @Test
    method testIllegalExceptionIsThrownWhenLambdaIsNegative (line 163) | @Test
    method testIllegalExceptionIsThrownWhenPoolSizeIsZero (line 169) | @Test
    method testIllegalExceptionIsThrownWhenPoolSizeIsNegative (line 176) | @Test
    method testPoolSizeIsZeroWhenParallelExecutionIsDisabled (line 182) | @Test
    method testShingleSize (line 191) | @Test
    method testCache (line 197) | @Test
    method initalPointStore (line 205) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/RandomCutForestConsistencyFunctionalTest.java
  class RandomCutForestConsistencyFunctionalTest (line 34) | @Tag("functional")
    method testConsistentScoring (line 42) | @Test
    method testConsistentScoringSinglePrecision (line 113) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/RandomCutForestFunctionalTest.java
  class RandomCutForestFunctionalTest (line 42) | @Tag("functional")
    method oneTimeSetUp (line 61) | @BeforeAll
    class TestForestProvider (line 98) | static class TestForestProvider implements ArgumentsProvider {
      method provideArguments (line 99) | @Override
    method getDisplacementScore (line 113) | public static double getDisplacementScore(RandomCutForest forest, floa...
    method getDisplacementScoreApproximate (line 117) | public double getDisplacementScoreApproximate(RandomCutForest forest, ...
    method getHeightScore (line 133) | public static double getHeightScore(RandomCutForest forest, float[] po...
    method getHeightScoreApproximate (line 137) | public double getHeightScoreApproximate(RandomCutForest forest, float[...
    method testGetAnomalyScore (line 142) | @ParameterizedTest
    method testSideEffectsA (line 219) | @ParameterizedTest
    method testSideEffectsB (line 233) | @ParameterizedTest
    method testGetAnomalyAttribution (line 252) | @ParameterizedTest
    method testMultipleAttributions (line 276) | @ParameterizedTest
    method testUpdateWithSignedZeros (line 419) | @Test
    method testShadowBuffer (line 433) | @Test
    method testSimpleDensity (line 535) | @ParameterizedTest
    method testSimpleDensityWhenSamplerNotFullThenDensityIsZero (line 550) | @ParameterizedTest
    method testImputeMissingValues (line 560) | @ParameterizedTest
    method getTotalUpdates_returnExpectedSize (line 573) | @Test
    method dynamicCachingChangeTest (line 579) | @ParameterizedTest(name = "{index} => numDims={0}, numTrees={1}, numSa...
    method dynamicCachingChangeTestLarge (line 618) | @ParameterizedTest(name = "{index} => numDims={0}, numTrees={1}, numSa...
    method generate (line 647) | private double[][] generate(int numSamples, int numDimensions, int see...

FILE: Java/core/src/test/java/com/amazon/randomcutforest/RandomCutForestShingledFunctionalTest.java
  class RandomCutForestShingledFunctionalTest (line 47) | @Tag("functional")
    method oneTimeSetUp (line 65) | @BeforeAll
    method testExtrapolateBasic (line 100) | @Test
    method InternalShinglingTest (line 116) | @ParameterizedTest
    method testExtrapolateShingleAwareSinglePrecision (line 202) | @Test
    method testExtrapolateInternalRotationSinglePrecision (line 266) | @Test
    method testExtrapolateC (line 330) | @Test
    method getDataA (line 436) | double[] getDataA(double amplitude, double noise) {
    method getDataB (line 456) | double[] getDataB(double amplitude, double noise) {
    method getShinglePoint (line 475) | private static double[] getShinglePoint(double[] recentPointsSeen, int...
    method testUpdate (line 486) | @Test
    method genShingledData (line 509) | private static double[][] genShingledData(int size, int dimensions, lo...
    method getDataD (line 530) | private static double[] getDataD(int num, double amplitude, double noi...

FILE: Java/core/src/test/java/com/amazon/randomcutforest/RandomCutForestTest.java
  class RandomCutForestTest (line 85) | public class RandomCutForestTest {
    method setUp (line 96) | @BeforeEach
    method checkOutput (line 123) | @Test
    method checkParameters (line 137) | @Test
    method testUpdate (line 156) | @Test
    method testUpdateShingled (line 164) | @Test
    method testUpdateInvalid (line 172) | @Test
    method testTraverseForestBinaryAccumulator (line 181) | @Test
    method testTraverseForestBinaryAccumulatorInvalid (line 194) | @Test
    method testTraverseForestCollector (line 213) | @Test
    method testTraverseForestCollectorInvalid (line 224) | @Test
    method testTraverseForestConverging (line 240) | @Test
    method testTraverseForestConvergingInvalid (line 256) | @Test
    method traverseForestMultiBinaryAccumulator (line 278) | @Test
    method testTraverseForestMultiBinaryAccumulatorInvalid (line 291) | @Test
    method testTraverseForestMultiCollector (line 310) | @Test
    method testTraverseForestCollectorMultiInvalid (line 322) | @Test
    method testGetAnomalyScore (line 338) | @Test
    method testGetApproximateAnomalyScore (line 363) | @Test
    method testGetAnomalyAttribution (line 394) | @Test
    method testGetApproximateAnomalyAttribution (line 429) | @Test
    method testGetSimpleDensity (line 471) | @Test
    method testImputeMissingValuesInvalid (line 506) | @Test
    method testImputeMissingValuesWithNoMissingValues (line 517) | @Test
    method testImputeMissingValuesWithOutputNotReady (line 526) | @Test
    method testExtrapolateBasic (line 537) | @Test
    method testExtrapolateBasicInvalid (line 565) | @Test
    method testExtrapolateBasicWithShingleBuilder (line 596) | @Test
    method testExtrapolateBasicSliding (line 616) | @Test
    method testExtrapolateBasicCyclic (line 653) | @Test
    method testGetNearNeighborInSample (line 679) | @Test
    method testGetNearNeighborsInSampleBeforeOutputReady (line 739) | @Test
    method testGetNearNeighborsInSampleNoDistanceThreshold (line 745) | @Test
    method testGetNearNeighborsInSampleInvalid (line 752) | @Test
    method testUpdateOnSmallBoundingBox (line 761) | @Test
    method testSamplersFull (line 775) | @Test
    method testGetTotalUpdates (line 790) | @Test
    method testIsOutputReady (line 797) | @Test
    method testUpdateAfterRoundTrip (line 827) | @Test
    method testUpdateAfterRoundTripWithPause (line 856) | @Test
    method testUpdateAfterRoundTripMediumNodeStore (line 907) | @Test
    method testUpdateAfterRoundTripLargeNodeStore (line 943) | @Test
    method testInternalShinglingRotated (line 979) | @Test
    method testComponents (line 996) | @Test
    method testOutOfOrderUpdate (line 1009) | @Test
    method testFloatingPointRandomCut (line 1026) | @Test
    method generateShingledData (line 1044) | public static double[][] generateShingledData(int size, int dimensions...
    method getShinglePoint (line 1065) | private static double[] getShinglePoint(double[] recentPointsSeen, int...
    method getDataD (line 1076) | static double[] getDataD(int num, double amplitude, double noise, long...

FILE: Java/core/src/test/java/com/amazon/randomcutforest/SampleSummaryTest.java
  class SampleSummaryTest (line 52) | @Tag("functional")
    method configAndAbsorbTest (line 64) | @Test
    method TestMultiCenter (line 170) | @Test
    method testCenter (line 223) | @Test
    method zeroTest (line 263) | @Test
    method SummaryTest (line 292) | @ParameterizedTest
    method ParallelTest (line 321) | @ParameterizedTest
    method SampleSummaryTestL2 (line 355) | @Test
    method IdempotenceTestL2 (line 389) | @Test
    method getData (line 424) | public float[][] getData(int dataSize, int newDimensions, int seed, Bi...
    method generateArguments (line 463) | private static Stream<Arguments> generateArguments() {

FILE: Java/core/src/test/java/com/amazon/randomcutforest/TestUtils.java
  class TestUtils (line 27) | public class TestUtils {
    method accept (line 35) | @Override
    method getResult (line 39) | @Override
    method accept (line 49) | @Override
    method getResult (line 53) | @Override
    method trigger (line 58) | @Override
    method newPartialCopy (line 63) | @Override
    method combine (line 68) | @Override
    method convergeAfter (line 94) | public static ConvergingAccumulator<Double> convergeAfter(int numberOf...
    method accept (line 127) | @Override
    method getResult (line 131) | @Override
    method trigger (line 136) | @Override
    method newPartialCopy (line 141) | @Override
    method combine (line 146) | @Override

FILE: Java/core/src/test/java/com/amazon/randomcutforest/anomalydetection/AnomalyAttributionVisitorTest.java
  class AnomalyAttributionVisitorTest (line 39) | public class AnomalyAttributionVisitorTest {
    method testNew (line 41) | @Test
    method testNewWithIgnoreOptions (line 60) | @Test
    method testAcceptLeafEquals (line 79) | @Test
    method testAcceptLeafNotEquals (line 106) | @Test
    method testAccept (line 159) | @Test
    method reNormalizeNotEqual (line 247) | @ParameterizedTest
    method reNormalize (line 273) | @ParameterizedTest

FILE: Java/core/src/test/java/com/amazon/randomcutforest/anomalydetection/AnomalyScoreVisitorTest.java
  class AnomalyScoreVisitorTest (line 42) | public class AnomalyScoreVisitorTest {
    method testNew (line 44) | @Test
    method testNewWithIgnoreOptions (line 60) | @Test
    method testAcceptLeafEquals (line 76) | @Test
    method testAcceptLeafNotEquals (line 113) | @Test
    method testAcceptEqualsLeafPoint (line 142) | @Test
    method testAccept (line 175) | @Test
    method testGetProbabilityOfSeparation (line 222) | @Test
    method test_getProbabilityOfSeparation_leafNode (line 280) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/anomalydetection/DynamicAttributionVisitorTest.java
  class DynamicAttributionVisitorTest (line 24) | public class DynamicAttributionVisitorTest {
    method testScoringMethods (line 25) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/anomalydetection/DynamicScoreVisitorTest.java
  class DynamicScoreVisitorTest (line 24) | public class DynamicScoreVisitorTest {
    method testScoringMethods (line 25) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/executor/ForestTraversalExecutorTest.java
  class ForestTraversalExecutorTest (line 57) | public class ForestTraversalExecutorTest {
    class TestExecutorProvider (line 62) | private static class TestExecutorProvider implements ArgumentsProvider {
      method provideArguments (line 63) | @Override
    method testTraverseForestBinaryAccumulator (line 91) | @ParameterizedTest
    method testTraverseForestCollector (line 116) | @ParameterizedTest
    method testTraverseForestConverging (line 144) | @ParameterizedTest
    method testTraverseForestMultiBinaryAccumulator (line 170) | @ParameterizedTest
    method testTraverseForestMultiCollector (line 195) | @ParameterizedTest
    method testException (line 223) | @Test
    method threadpoolOne (line 242) | @Test
    method constructorTest (line 250) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/executor/ForestUpdateExecutorTest.java
  class ForestUpdateExecutorTest (line 49) | @ExtendWith(MockitoExtension.class)
    class TestExecutorProvider (line 58) | private static class TestExecutorProvider implements ArgumentsProvider {
      method provideArguments (line 59) | @Override
    method testUpdate (line 85) | @ParameterizedTest
    method testCleanCopy (line 135) | @ParameterizedTest
    method constructorTest (line 152) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/executor/PointStoreCoordinatorTest.java
  class PointStoreCoordinatorTest (line 36) | public class PointStoreCoordinatorTest {
    method setUp (line 41) | @BeforeEach
    method testInitUpdate (line 47) | @Test
    method testCompleteUpdate (line 61) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/executor/SamplerPlusTreeTest.java
  class SamplerPlusTreeTest (line 41) | @ExtendWith(MockitoExtension.class)
    method setUp (line 49) | @BeforeEach
    method testUpdateAddPoint (line 54) | @Test
    method testUpdateAddAndDeletePoint (line 72) | @Test
    method testRejectPoint (line 98) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/executor/UpdateResultTest.java
  class UpdateResultTest (line 22) | public class UpdateResultTest {
    method testNoop (line 23) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/imputation/ConditionalSampleSummarizerTest.java
  class ConditionalSampleSummarizerTest (line 35) | public class ConditionalSampleSummarizerTest {
    method setUp (line 42) | @BeforeEach
    method testSummarize (line 50) | @Test
    method testZero (line 82) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/imputation/ImputeVisitorTest.java
  class ImputeVisitorTest (line 41) | public class ImputeVisitorTest {
    method setUp (line 49) | @BeforeEach
    method testNew (line 63) | @Test
    method testCopyConstructor (line 83) | @Test
    method testAcceptLeafEquals (line 91) | @Test
    method testAcceptLeafEqualsZeroDepth (line 112) | @Test
    method testAcceptLeafNotEquals (line 132) | @Test
    method testAccept (line 151) | @Test
    method testNewCopy (line 186) | @Test
    method testMerge (line 194) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/inspect/NearNeighborVisitorTest.java
  class NearNeighborVisitorTest (line 41) | public class NearNeighborVisitorTest {
    method setUp (line 47) | @BeforeEach
    method acceptLeafNear (line 54) | @Test
    method acceptLeafNearTimestampsDisabled (line 78) | @Test
    method acceptLeafNotNear (line 109) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/interpolation/SimpleInterpolationVisitorTest.java
  class SimpleInterpolationVisitorTest (line 34) | public class SimpleInterpolationVisitorTest {
    method testNew (line 38) | @Test
    method testAcceptLeafEquals (line 63) | @Test
    method testAcceptLeafNotEquals (line 93) | @Test
    method testAcceptEqualsLeafPoint (line 136) | @Test
    method testAccept (line 242) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/preprocessor/PreprocessorTest.java
  class PreprocessorTest (line 59) | public class PreprocessorTest {
    method testConfig (line 61) | @Test
    method preprocessorPlusForest (line 190) | public void preprocessorPlusForest(int seed, ForestMode mode, Transfor...
    method preprocessorTest (line 290) | @ParameterizedTest
    method allMissing (line 307) | @ParameterizedTest
    method allMissingWithForest (line 357) | @ParameterizedTest
    method basicPreProcessor (line 407) | @ParameterizedTest
    method streamingImputeLargeGap (line 447) | @ParameterizedTest

FILE: Java/core/src/test/java/com/amazon/randomcutforest/preprocessor/transform/WeightedTransformerTest.java
  class WeightedTransformerTest (line 29) | public class WeightedTransformerTest {
    method checkTransformer (line 31) | public void checkTransformer(WeightedTransformer w, double value, doub...
    method constructorTest (line 50) | @Test
    method updateDeviationsTest (line 71) | @Test
    method normalizeTest (line 85) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/returntypes/DensityOutputTest.java
  class DensityOutputTest (line 26) | public class DensityOutputTest {
    method setUp (line 32) | @BeforeEach
    method testNew (line 39) | @Test
    method testAddToLeft (line 50) | @Test
    method testGetDensity (line 100) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/returntypes/DiVectorTest.java
  class DiVectorTest (line 34) | public class DiVectorTest {
    method setUp (line 39) | @BeforeEach
    method testNew (line 45) | @Test
    method testAddToLeft (line 56) | @Test
    method testScale (line 87) | @Test
    method testGetHighLowSum (line 109) | @Test
    method testRenormalize (line 117) | @Test
    method testComponentwiseTransform (line 136) | @Test
    method testMapper (line 155) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/returntypes/InterpolationMeasureTest.java
  class InterpolationMeasureTest (line 26) | public class InterpolationMeasureTest {
    method setUp (line 32) | @BeforeEach
    method testNew (line 39) | @Test
    method testAddToLeft (line 57) | @Test
    method testScale (line 109) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/returntypes/NeighborTest.java
  class NeighborTest (line 28) | public class NeighborTest {
    method testNew (line 29) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/returntypes/OneSidedConvergingDiVectorTest.java
  class OneSidedConvergingDiVectorTest (line 25) | public class OneSidedConvergingDiVectorTest {
    method setUp (line 34) | @BeforeEach
    method testGetConvergingValue (line 45) | @Test
    method testAccumulateValue (line 55) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/returntypes/OneSidedConvergingDoubleAccumulatorTest.java
  class OneSidedConvergingDoubleAccumulatorTest (line 28) | public class OneSidedConvergingDoubleAccumulatorTest {
    method setUp (line 36) | @BeforeEach
    method testGetConvergingValue (line 46) | @Test
    method testAccumulateValue (line 52) | @Test
    method testConvergenceHighIsCritical (line 63) | @Test
    method testConvergenceLowIsCritical (line 99) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/returntypes/RangeVectorTest.java
  class RangeVectorTest (line 25) | public class RangeVectorTest {
    method setUp (line 30) | @BeforeEach
    method testNew (line 36) | @Test
    method testScale (line 64) | @Test
    method testShift (line 88) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/returntypes/SampleSummaryTest.java
  class SampleSummaryTest (line 34) | public class SampleSummaryTest {
    method testConstructor (line 44) | @Test
    method addTypicalTest (line 78) | @Test
    method getData (line 101) | public float[][] getData(int dataSize, int newDimensions, int seed, Bi...

FILE: Java/core/src/test/java/com/amazon/randomcutforest/returntypes/TimedRangeVectorTest.java
  class TimedRangeVectorTest (line 26) | public class TimedRangeVectorTest {
    method setUp (line 32) | @BeforeEach
    method testNew (line 39) | @Test
    method testScale (line 56) | @Test
    method testShift (line 73) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/runner/AnomalyAttributionRunnerTest.java
  class AnomalyAttributionRunnerTest (line 34) | public class AnomalyAttributionRunnerTest {
    method setUp (line 47) | @BeforeEach
    method testRun (line 65) | @Test
    method testWriteHeader (line 74) | @Test
    method testProcessLine (line 82) | @Test
    method testAnomalyAttributionTransformer (line 90) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/runner/AnomalyScoreRunnerTest.java
  class AnomalyScoreRunnerTest (line 33) | public class AnomalyScoreRunnerTest {
    method setUp (line 46) | @BeforeEach
    method testRun (line 64) | @Test
    method testWriteHeader (line 73) | @Test
    method testProcessLine (line 81) | @Test
    method testAnomalyScoreTransformer (line 89) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/runner/ArgumentParserTest.java
  class ArgumentParserTest (line 25) | public class ArgumentParserTest {
    method setUp (line 29) | @BeforeEach
    method testNew (line 34) | @Test
    method testParse (line 46) | @Test
    method testParseShortFlags (line 61) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/runner/ImputeRunnerTest.java
  class ImputeRunnerTest (line 28) | public class ImputeRunnerTest {
    method setUp (line 41) | @BeforeEach
    method testRun (line 59) | @Test
    method testWriteHeader (line 68) | @Test
    method testProcessLine (line 76) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/runner/SimpleDensityRunnerTest.java
  class SimpleDensityRunnerTest (line 34) | public class SimpleDensityRunnerTest {
    method setUp (line 46) | @BeforeEach
    method testRun (line 64) | @Test
    method testWriteHeader (line 74) | @Test
    method testProcessLine (line 82) | @Test
    method testSimpleDensityTransformer (line 91) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/runner/UpdateOnlyTransformerTest.java
  class UpdateOnlyTransformerTest (line 29) | public class UpdateOnlyTransformerTest {
    method setUp (line 34) | @BeforeEach
    method testGetResultValues (line 40) | @Test
    method testGetEmptyResultValue (line 47) | @Test
    method testGetResultColumnNames (line 52) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/sampler/CompactSamplerTest.java
  class CompactSamplerTest (line 49) | public class CompactSamplerTest {
    class SamplerProvider (line 55) | private static class SamplerProvider implements ArgumentsProvider {
      method provideArguments (line 56) | @Override
    method testNew (line 73) | @ParameterizedTest
    method testNewFromExistingWeightsParameters (line 105) | @Test
    method testNewFromExistingWeights (line 119) | @Test
    method testUniformSampler (line 148) | @Test
    method testBuilderClass (line 159) | @Test
    method testAddPoint (line 188) | @ParameterizedTest
    method testAcceptPoint (line 226) | @ParameterizedTest
    method testUpdate (line 272) | @ParameterizedTest
    method testGetScore (line 299) | @ParameterizedTest
    method testValidateHeap (line 324) | @ParameterizedTest

FILE: Java/core/src/test/java/com/amazon/randomcutforest/state/RandomCutForestMapperTest.java
  class RandomCutForestMapperTest (line 55) | public class RandomCutForestMapperTest {
    method compactForestProvider (line 62) | private static Stream<RandomCutForest> compactForestProvider() {
    method setUp (line 74) | @BeforeEach
    method assertCompactForestEquals (line 80) | public void assertCompactForestEquals(RandomCutForest forest, RandomCu...
    method testForest (line 117) | void testForest(RandomCutForest forest, Boolean saveTree) {
    method testRoundTripForCompactForest (line 127) | @ParameterizedTest
    method testRoundTripForCompactForestSaveTreeState (line 133) | @ParameterizedTest
    method testRoundTripForCompactForestSaveTreeStatePartial (line 140) | @ParameterizedTest
    method testSaveSamplers (line 148) | @Test
    method executionContext (line 161) | @Test
    method testVersion (line 171) | @Test
    method testPrecisionException (line 178) | @Test
    method testRoundTripForEmptyForest (line 188) | @Test
    method testRoundTripForSingleNodeForest (line 201) | @Test
    method generate (line 227) | private static float[] generate(int input) {
    method benchmarkMappers (line 231) | @Test
    method testJson (line 253) | @ParameterizedTest
    method testPreprocessorJson (line 272) | @ParameterizedTest
    method getStateFromFile (line 285) | private String getStateFromFile(String resourceFile) {

FILE: Java/core/src/test/java/com/amazon/randomcutforest/state/V2PreProcessorJsonResource.java
  type V2PreProcessorJsonResource (line 20) | @Getter
    method V2PreProcessorJsonResource (line 27) | V2PreProcessorJsonResource(String resource) {

FILE: Java/core/src/test/java/com/amazon/randomcutforest/state/V2RCFJsonResource.java
  type V2RCFJsonResource (line 20) | @Getter
    method V2RCFJsonResource (line 27) | V2RCFJsonResource(String resource) {

FILE: Java/core/src/test/java/com/amazon/randomcutforest/state/sampler/CompactSamplerMapperTest.java
  class CompactSamplerMapperTest (line 35) | public class CompactSamplerMapperTest {
    method nonemptySamplerProvider (line 41) | public static Stream<Arguments> nonemptySamplerProvider() {
    method samplerProvider (line 72) | public static Stream<Arguments> samplerProvider() {
    method setUp (line 85) | @BeforeEach
    method assertValidMapping (line 91) | private void assertValidMapping(CompactSampler original, CompactSample...
    method testRoundTripInvalidHeap (line 109) | @ParameterizedTest

FILE: Java/core/src/test/java/com/amazon/randomcutforest/state/store/PointStoreMapperTest.java
  class PointStoreMapperTest (line 30) | public class PointStoreMapperTest {
    method setUp (line 33) | @BeforeEach
    method testRoundTrip (line 38) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/statistics/StatisticsTest.java
  class StatisticsTest (line 28) | public class StatisticsTest {
    method constructorTest (line 30) | @Test
    method getMeanTest (line 42) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/store/PointStoreTest.java
  class PointStoreTest (line 33) | public class PointStoreTest {
    method setUp (line 39) | @BeforeEach
    method testNew (line 46) | @Test
    method testConstructors (line 69) | @Test
    method testAdd (line 89) | @Test
    method testAddInvalid (line 118) | @Test
    method testGetInvalid (line 131) | @Test
    method testIncrementRefCount (line 137) | @Test
    method testIncrementRefCountInvalid (line 147) | @Test
    method testDecrementRefCount (line 153) | @Test
    method testDecrementRefCountInvalid (line 170) | @Test
    method testPointEquals (line 176) | @Test
    method testPointEqualsInvalid (line 184) | @Test
    method internalShinglingTestNoRotation (line 191) | @Test
    method internalShinglingTestWithRotation (line 214) | @Test
    method checkRotationAndCompact (line 243) | @Test
    method CompactionTest (line 286) | @Test
    method indexIntervalTest (line 308) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/store/StreamSamplerTest.java
  class StreamSamplerTest (line 26) | public class StreamSamplerTest {
    method testBuilder (line 28) | @Test
    method testConstructor (line 36) | @Test
    method testConfig (line 54) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/tree/BoundingBoxTest.java
  class BoundingBoxTest (line 34) | public class BoundingBoxTest {
    method setUp (line 41) | @BeforeEach
    method dimensionTest (line 49) | @Test
    method equalsTest (line 57) | @Test
    method testNewFromSinglePoint (line 65) | @Test
    method testGetMergedBoxWithOtherBox (line 89) | @Test
    method testContainsBoundingBox (line 131) | @Test
    method testContainsPoint (line 158) | @Test
    method probability (line 170) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/tree/BoxCacheTest.java
  class BoxCacheTest (line 28) | public class BoxCacheTest {
    method testChangingBoundingBoxFloat32 (line 30) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/tree/CutTest.java
  class CutTest (line 26) | public class CutTest {
    method setUp (line 32) | @BeforeEach
    method testNew (line 39) | @Test
    method testIsLeftOf (line 45) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/tree/HyperTreeTest.java
  class HyperTreeTest (line 38) | public class HyperTreeTest {
    method LAlphaSeparation (line 56) | public static Function<IBoundingBoxView, double[]> LAlphaSeparation(fi...
    method GTFSeparation (line 78) | public static Function<IBoundingBoxView, double[]> GTFSeparation(final...
    class HyperForest (line 97) | class HyperForest {
      method HyperForest (line 107) | public HyperForest(int dimensions, int numberOfTrees, int sampleSize...
      method getDisplacementScore (line 131) | public double getDisplacementScore(float[] point) {
      method getHeightScore (line 147) | public double getHeightScore(float[] point) {
      method getAnomalyScore (line 151) | public double getAnomalyScore(float[] point) {
      method getDynamicScore (line 156) | public double getDynamicScore(float[] point, BiFunction<Double, Doub...
      method makeForest (line 173) | void makeForest(double[][] pointList, int prefix) {
    method getSimulatedAnomalyScore (line 216) | public static double getSimulatedAnomalyScore(RandomCutForest forest, ...
    method getSimulatedHeightScore (line 222) | public static double getSimulatedHeightScore(RandomCutForest forest, f...
    method getSimulatedDisplacementScore (line 228) | public static double getSimulatedDisplacementScore(RandomCutForest for...
    method setup (line 234) | @BeforeAll
    class TestScores (line 252) | private class TestScores {
    method runRCF (line 264) | public static void runRCF(TestScores testScore, Function<IBoundingBoxV...
    method runGTFLAlpha (line 315) | public void runGTFLAlpha(TestScores testScore, boolean flag, double ga...
    method simulateGTFLAlpha (line 371) | public void simulateGTFLAlpha(TestScores testScore, boolean flag, doub...
    method GaugeTransductiveForestTest (line 378) | @Test
    method LAlphaForestTest (line 388) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/tree/RandomCutTreeTest.java
  class RandomCutTreeTest (line 56) | public class RandomCutTreeTest {
    method setUp (line 65) | @BeforeEach
    method testConfig (line 130) | @Test
    method testConfigStore (line 144) | @Test
    method testParent (line 154) | @Test
    method testConfigDelete (line 162) | @Test
    method testConfigAdd (line 179) | @Test
    method testConfigPartialAdd (line 225) | @Test
    method testCut (line 245) | @Test
    method testInitialTreeState (line 276) | @Test
    method testTreeMapper (line 339) | @Test
    method treeTraversal (line 351) | @Test
    method testDeletePointWithLeafSibling (line 392) | @Test
    method testDeletePointWithNonLeafSibling (line 439) | @Test
    method testDeletePointWithMassGreaterThan1 (line 481) | @Test
    method testDeletePointInvalid (line 571) | @Test
    method testUpdatesOnSmallBoundingBox (line 580) | @Test
    method testfloat (line 604) | @Test
    method testNodeStore (line 636) | @ParameterizedTest
    method cutTest1 (line 673) | @Test
    method cutTest2 (line 681) | @Test
    method cutTestMultiD (line 688) | @Test
    method traverseTest (line 736) | @Test
    method invalidNodeTest (line 747) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/util/ArrayPackingTest.java
  class ArrayPackingTest (line 37) | public class ArrayPackingTest {
    method setUp (line 40) | @BeforeEach
    method testLogMax (line 46) | @Test
    method testLogMaxInvalid (line 56) | @Test
    method testIntsPackRoundTrip (line 63) | @ParameterizedTest
    method testShortsPackRoundTrip (line 71) | @ParameterizedTest
    method testIdenticalInts (line 82) | @ParameterizedTest
    method testIdenticalShorts (line 93) | @ParameterizedTest
    method testUnpackIntsWithLengthGiven (line 107) | @Test
    method testUnpackShortsWithLengthGiven (line 146) | @Test
    method testPackDoublesRoundTrip (line 176) | @ParameterizedTest
    method testPackFloatsRoundTrip (line 183) | @ParameterizedTest
    method testPackShortsWithLength (line 193) | @ParameterizedTest
    method testPackDoublesWithLength (line 211) | @Test
    method testPackFloatsWithLength (line 226) | @Test
    method testUnpackDoublesWithLength (line 244) | @Test
    method testUnpackFloatWithLength (line 265) | @Test
    method testConfig (line 288) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/util/ArrayUtilsTest.java
  class ArrayUtilsTest (line 34) | public class ArrayUtilsTest {
    method cleanCopy (line 38) | @ParameterizedTest
    method array (line 47) | private double[] array(String arrayString) {
    method testNullable (line 51) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/util/ShingleBuilderTest.java
  class ShingleBuilderTest (line 26) | public class ShingleBuilderTest {
    method setUp (line 32) | @BeforeEach
    method testNew (line 39) | @Test
    method testNewWithInvalidArguments (line 46) | @Test
    method testAddPoint (line 52) | @Test
    method testAddPointCyclic (line 74) | @Test
    method testAddPointWithInvalidArguments (line 97) | @Test
    method testShingleCopy (line 105) | @Test
    method testGetShingleWithInvalidArguments (line 124) | @Test

FILE: Java/core/src/test/java/com/amazon/randomcutforest/util/WeightedTest.java
  class WeightedTest (line 30) | public class WeightedTest {
    method setUp (line 36) | @BeforeEach
    method testCreateSample (line 47) | @Test
    method testPrefixPick (line 58) | @Test
    method emptyList (line 78) | @Test

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/Example.java
  type Example (line 18) | public interface Example {
    method command (line 19) | String command();
    method description (line 21) | String description();
    method run (line 23) | void run() throws Exception;

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/Main.java
  class Main (line 26) | public class Main {
    method main (line 30) | public static void main(String[] args) throws Exception {
    method Main (line 37) | public Main() {
    method add (line 46) | private void add(Example example) {
    method run (line 53) | public void run(String[] args) throws Exception {
    method printUsage (line 67) | public void printUsage() {

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/dynamicconfiguration/DynamicSampling.java
  class DynamicSampling (line 24) | public class DynamicSampling implements Example {
    method main (line 26) | public static void main(String[] args) throws Exception {
    method command (line 30) | @Override
    method description (line 35) | @Override
    method run (line 40) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/dynamicconfiguration/DynamicThroughput.java
  class DynamicThroughput (line 26) | public class DynamicThroughput implements Example {
    method main (line 28) | public static void main(String[] args) throws Exception {
    method command (line 32) | @Override
    method description (line 37) | @Override
    method run (line 42) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/dynamicinference/ConditionalPredictive.java
  class ConditionalPredictive (line 32) | public class ConditionalPredictive implements Example {
    method main (line 34) | public static void main(String[] args) throws Exception {
    method command (line 38) | @Override
    method description (line 43) | @Override
    method run (line 48) | @Override
    method generateRecordKey (line 94) | float[] generateRecordKey(Random random) {
    method fillInValues (line 124) | void fillInValues(float[] record, Random random, NormalDistribution no...
    class NormalDistribution (line 147) | static class NormalDistribution {
      method NormalDistribution (line 152) | NormalDistribution(Random rng) {
      method nextDouble (line 158) | double nextDouble() {
      method nextDouble (line 174) | double nextDouble(double mu, double sigma) {

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/dynamicinference/DynamicDensity.java
  class DynamicDensity (line 29) | public class DynamicDensity implements Example {
    method main (line 31) | public static void main(String[] args) throws Exception {
    method command (line 35) | @Override
    method description (line 40) | @Override
    method run (line 55) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/dynamicinference/DynamicNearNeighbor.java
  class DynamicNearNeighbor (line 28) | public class DynamicNearNeighbor implements Example {
    method main (line 30) | public static void main(String[] args) throws Exception {
    method command (line 34) | @Override
    method description (line 39) | @Override
    method run (line 45) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/ForecastWithLimits.java
  class ForecastWithLimits (line 67) | public class ForecastWithLimits implements Example {
    method main (line 69) | public static void main(String[] args) throws Exception {
    method command (line 73) | @Override
    method description (line 78) | @Override
    method run (line 83) | @Override
    method printResult (line 148) | void printResult(BufferedWriter file, ForecastDescriptor result, int c...

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/LowNoisePeriodic.java
  class LowNoisePeriodic (line 27) | public class LowNoisePeriodic implements Example {
    method main (line 29) | public static void main(String[] args) throws Exception {
    method command (line 33) | @Override
    method description (line 38) | @Override
    method run (line 43) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/NumericGLADexample.java
  class NumericGLADexample (line 86) | public class NumericGLADexample implements Example {
    method main (line 88) | public static void main(String[] args) throws Exception {
    method command (line 92) | @Override
    method description (line 97) | @Override
    method run (line 102) | @Override
    method shiftedEllipse (line 221) | public double[][] shiftedEllipse(int dataSize, int seed, double shift,...
    method precision (line 238) | double precision(int truePos, int falsePos) {
    method recall (line 242) | double recall(int truePos, int falseNeg) {

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/RCFCasterExample.java
  class RCFCasterExample (line 60) | public class RCFCasterExample implements Example {
    method main (line 62) | public static void main(String[] args) throws Exception {
    method command (line 66) | @Override
    method description (line 71) | @Override
    method run (line 76) | @Override
    method printResult (line 151) | void printResult(BufferedWriter file, ForecastDescriptor result, int c...

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/ScoringStrategyExample.java
  class ScoringStrategyExample (line 31) | public class ScoringStrategyExample implements Example {
    method main (line 33) | public static void main(String[] args) throws Exception {
    method command (line 37) | @Override
    method description (line 42) | @Override
    method run (line 47) | @Override
    method printResult (line 105) | void printResult(String description, AnomalyDescriptor result, long co...

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/SequentialAnomalyExample.java
  class SequentialAnomalyExample (line 29) | public class SequentialAnomalyExample implements Example {
    method main (line 31) | public static void main(String[] args) throws Exception {
    method command (line 35) | @Override
    method description (line 40) | @Override
    method run (line 45) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/SequentialForecastExample.java
  class SequentialForecastExample (line 29) | public class SequentialForecastExample implements Example {
    method main (line 31) | public static void main(String[] args) throws Exception {
    method command (line 35) | @Override
    method description (line 40) | @Override
    method run (line 45) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/StringGLADexample.java
  class StringGLADexample (line 36) | public class StringGLADexample implements Example {
    method main (line 38) | public static void main(String[] args) throws Exception {
    method command (line 42) | @Override
    method description (line 47) | @Override
    method run (line 52) | @Override
    method toyD (line 141) | public static double toyD(char[] a, char[] b, double u) {
    method printCharArray (line 168) | public static void printCharArray(char[] a) {
    method printClusters (line 179) | public void printClusters(List<ICluster<char[]>> summary) {
    method getABArray (line 197) | public char[] getABArray(int size, double probabilityOfA, Random rando...
    method precision (line 214) | double precision(int truePos, int falsePos) {
    method recall (line 218) | double recall(int truePos, int falseNeg) {

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/Thresholded1DGaussianMix.java
  class Thresholded1DGaussianMix (line 28) | public class Thresholded1DGaussianMix implements Example {
    method main (line 30) | public static void main(String[] args) throws Exception {
    method command (line 34) | @Override
    method description (line 39) | @Override
    method run (line 44) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/ThresholdedForecast.java
  class ThresholdedForecast (line 29) | public class ThresholdedForecast implements Example {
    method main (line 31) | public static void main(String[] args) throws Exception {
    method command (line 35) | @Override
    method description (line 40) | @Override
    method run (line 45) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/ThresholdedImpute.java
  class ThresholdedImpute (line 31) | public class ThresholdedImpute implements Example {
    method main (line 33) | public static void main(String[] args) throws Exception {
    method command (line 37) | @Override
    method description (line 42) | @Override
    method run (line 47) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/ThresholdedInternalShinglingExample.java
  class ThresholdedInternalShinglingExample (line 32) | public class ThresholdedInternalShinglingExample implements Example {
    method main (line 34) | public static void main(String[] args) throws Exception {
    method command (line 38) | @Override
    method description (line 43) | @Override
    method run (line 48) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/ThresholdedMultiDimensionalExample.java
  class ThresholdedMultiDimensionalExample (line 29) | public class ThresholdedMultiDimensionalExample implements Example {
    method main (line 31) | public static void main(String[] args) throws Exception {
    method command (line 35) | @Override
    method description (line 40) | @Override
    method run (line 45) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/ThresholdedPredictive.java
  class ThresholdedPredictive (line 28) | public class ThresholdedPredictive implements Example {
    method main (line 30) | public static void main(String[] args) throws Exception {
    method command (line 34) | @Override
    method description (line 39) | @Override
    method run (line 44) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/ThresholdedRCFJsonExample.java
  class ThresholdedRCFJsonExample (line 33) | public class ThresholdedRCFJsonExample implements Example {
    method main (line 35) | public static void main(String[] args) throws Exception {
    method command (line 39) | @Override
    method description (line 44) | @Override
    method run (line 49) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/parkservices/ThresholdedTime.java
  class ThresholdedTime (line 28) | public class ThresholdedTime implements Example {
    method main (line 30) | public static void main(String[] args) throws Exception {
    method command (line 34) | @Override
    method description (line 39) | @Override
    method run (line 44) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/serialization/JsonExample.java
  class JsonExample (line 30) | public class JsonExample implements Example {
    method main (line 32) | public static void main(String[] args) throws Exception {
    method command (line 36) | @Override
    method description (line 41) | @Override
    method run (line 46) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/serialization/ObjectStreamExample.java
  class ObjectStreamExample (line 31) | public class ObjectStreamExample implements Example {
    method main (line 33) | public static void main(String[] args) throws Exception {
    method command (line 37) | @Override
    method description (line 42) | @Override
    method run (line 47) | @Override
    method serialize (line 116) | private byte[] serialize(Object model) {
    method deserialize (line 127) | private Object deserialize(byte[] modelBin) {

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/serialization/ProtostuffExample.java
  class ProtostuffExample (line 34) | public class ProtostuffExample implements Example {
    method main (line 35) | public static void main(String[] args) throws Exception {
    method command (line 39) | @Override
    method description (line 44) | @Override
    method run (line 49) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/serialization/ProtostuffExampleWithDynamicLambda.java
  class ProtostuffExampleWithDynamicLambda (line 36) | public class ProtostuffExampleWithDynamicLambda implements Example {
    method main (line 37) | public static void main(String[] args) throws Exception {
    method command (line 41) | @Override
    method description (line 46) | @Override
    method run (line 51) | @Override

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/serialization/ProtostuffExampleWithShingles.java
  class ProtostuffExampleWithShingles (line 37) | public class ProtostuffExampleWithShingles implements Example {
    method main (line 38) | public static void main(String[] args) throws Exception {
    method command (line 42) | @Override
    method description (line 47) | @Override
    method run (line 52) | @Override
    method generateShingledData (line 127) | private double[][] generateShingledData(int size, int dimensions, long...
    method getShinglePoint (line 148) | private static double[] getShinglePoint(double[] recentPointsSeen, int...
    method getDataD (line 159) | double[] getDataD(int num, double amplitude, double noise, long seed) {

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/summarization/DynamicSummarization.java
  class DynamicSummarization (line 66) | public class DynamicSummarization implements Example {
    method main (line 68) | public static void main(String[] args) throws Exception {
    method command (line 72) | @Override
    method description (line 77) | @Override
    method run (line 82) | @Override
    method getData (line 151) | public double[][] getData(int dataSize, int seed, int fans) {
    method align (line 170) | int[] align(List<ICluster<float[]>> current, List<ICluster<float[]>> p...

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/summarization/RCFMultiSummarizeExample.java
  class RCFMultiSummarizeExample (line 46) | public class RCFMultiSummarizeExample implements Example {
    method main (line 48) | public static void main(String[] args) throws Exception {
    method command (line 52) | @Override
    method description (line 57) | @Override
    method run (line 62) | @Override
    method printArray (line 97) | void printArray(float[] values, double epsilon) {
    method getData (line 124) | public float[][] getData(int dataSize, int newDimensions, int seed, Bi...

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/summarization/RCFStringSummarizeExample.java
  class RCFStringSummarizeExample (line 43) | public class RCFStringSummarizeExample implements Example {
    method main (line 45) | public static void main(String[] args) throws Exception {
    method command (line 49) | @Override
    method description (line 54) | @Override
    method run (line 59) | @Override
    method toyDistance (line 100) | public static double toyDistance(String a, String b) {
    method printString (line 127) | public static void printString(String a) {
    method getABString (line 138) | public String getABString(int size, double probabilityOfA, Random rand...

FILE: Java/examples/src/main/java/com/amazon/randomcutforest/examples/summarization/RCFSummarizeExample.java
  class RCFSummarizeExample (line 45) | public class RCFSummarizeExample implements Example {
    method main (line 47) | public static void main(String[] args) throws Exception {
    method command (line 51) | @Override
    method description (line 56) | @Override
    method run (line 61) | @Override
    method printArray (line 85) | void printArray(float[] values, double epsilon) {
    method getData (line 112) | public float[][] getData(int dataSize, int newDimensions, int seed, Bi...

FILE: Java/parkservices/src/main/java/com/amazon/randomcutforest/parkservices/AnomalyDescriptor.java
  class AnomalyDescriptor (line 27) | @Getter
    method AnomalyDescriptor (line 64) | public AnomalyDescriptor(double[] input, long inputTimeStamp) {
    method setPastValues (line 68) | public void setPastValues(double[] values) {
    method isExpectedValuesPresent (line 72) | public boolean isExpectedValuesPresent() {
    method setRelevantAttribution (line 76) | public void setRelevantAttribution(double[] values) {
    method setExpectedValues (line 80) | public void setExpectedValues(int position, double[] values, double li...
    method setDataConfidence (line 92) | public void setDataConfidence(double timeDecay, long valuesSeen, long ...

FILE: Java/parkservices/src/main/java/com/amazon/randomcutforest/parkservices/ForecastDescriptor.java
  class ForecastDescriptor (line 29) | @Getter
    method ForecastDescriptor (line 78) | public ForecastDescriptor(double[] input, long inputTimeStamp, int hor...
    method setObservedErrorDistribution (line 90) | public void setObservedErrorDistribution(RangeVector base) {
    method setIntervalPrecision (line 97) | public void setIntervalPrecision(float[] calibration) {
    method getIntervalPrecision (line 101) | public float[] getIntervalPrecision() {
    method setErrorMean (line 105) | public void setErrorMean(float[] errorMean) {
    method setErrorRMSE (line 109) | public void setErrorRMSE(DiVector errorRMSE) {

FILE: Java/parkservices/src/main/java/com/amazon/randomcutforest/parkservices/GlobalLocalAnomalyDetector.java
  class GlobalLocalAnomalyDetector (line 38) | public class GlobalLocalAnomalyDetector<P> extends StreamSampler<P> {
    method builder (line 93) | public static Builder<?> builder() {
    method GlobalLocalAnomalyDetector (line 97) | protected GlobalLocalAnomalyDetector(Builder<?> builder) {
    method GlobalLocalAnomalyDetector (line 108) | protected GlobalLocalAnomalyDetector(Builder<?> builder, BiFunction<P,...
    method setGlobalDistance (line 113) | public void setGlobalDistance(BiFunction<P, P, Double> dist) {
    method setZfactor (line 120) | public void setZfactor(double factor) {
    method getZfactor (line 126) | public double getZfactor() {
    method setLowerThreshold (line 131) | public void setLowerThreshold(double lowerThreshold) {
    method getLowerThreshold (line 137) | public double getLowerThreshold() {
    method getDoNotreclusterWithin (line 141) | public int getDoNotreclusterWithin() {
    method setDoNotreclusterWithin (line 145) | public void setDoNotreclusterWithin(int value) {
    method getNumberOfRepresentatives (line 150) | public int getNumberOfRepresentatives() {
    method setNumberOfRepresentatives (line 154) | public void setNumberOfRepresentatives(int reps) {
    method getShrinkage (line 161) | public double getShrinkage() {
    method setShrinkage (line 165) | public void setShrinkage(double value) {
    method getIgnoreBelow (line 170) | public double getIgnoreBelow() {
    method setIgnoreBelow (line 174) | public void setIgnoreBelow(double value) {
    method getMaxAllowed (line 179) | public int getMaxAllowed() {
    method setMaxAllowed (line 183) | public void setMaxAllowed(int value) {
    method process (line 213) | public GenericAnomalyDescriptor<P> process(P object, float weight, BiF...
    method score (line 280) | public List<Weighted<P>> score(P current, BiFunction<P, P, Double> loc...
    method GlobalLocalAnomalyDetector (line 356) | public GlobalLocalAnomalyDetector(GlobalLocalAnomalyDetector first, Gl...
    class Candidate (line 377) | class Candidate {
      method Candidate (line 382) | Candidate(P representative, double averageRadiusOfCluster, double di...
    method getClusters (line 389) | public List<ICluster<P>> getClusters() {
    method getClusters (line 393) | public List<ICluster<P>> getClusters(int maxAllowed, int initial, int ...
    class Builder (line 404) | public static class Builder<T extends Builder<T>> extends StreamSample...
      method ignoreBelow (line 413) | public T ignoreBelow(double ignoreBelow) {
      method shrinkage (line 419) | public T shrinkage(double shrinkage) {
      method doNotReclusterWithin (line 426) | public T doNotReclusterWithin(int refresh) {
      method maxAllowed (line 432) | public T maxAllowed(int maxAllowed) {
      method numberOfRepresentatives (line 438) | public T numberOfRepresentatives(int number) {
      method anomalyRate (line 444) | public T anomalyRate(double anomalyRate) {
      method build (line 449) | @Override

FILE: Java/parkservices/src/main/java/com/amazon/randomcutforest/parkservices/PredictorCorrector.java
  class PredictorCorrector (line 49) | public class PredictorCorrector {
    method PredictorCorrector (line 119) | public PredictorCorrector(double timeDecay, double anomalyRate, boolea...
    method PredictorCorrector (line 142) | public PredictorCorrector(BasicThresholder[] thresholders, Deviation[]...
    method PredictorCorrector (line 173) | public PredictorCorrector(BasicThresholder thresholder, int baseDimens...
    method nextDouble (line 177) | protected double nextDouble() {
    method maxContribution (line 195) | protected int maxContribution(DiVector diVector, int baseDimension, in...
    method getExpectedPoint (line 227) | protected float[] getExpectedPoint(DiVector diVector, int position, in...
    method trigger (line 288) | protected boolean trigger(DiVector candidate, int difference, int base...
    method getCorrectionOfLastAnomaly (line 317) | public double[] getCorrectionOfLastAnomaly(TransformMethod transformMe...
    method applyPastCorrector (line 348) | protected <P extends AnomalyDescriptor> float[] applyPastCorrector(flo...
    method centeredTransformPass (line 404) | protected <P extends AnomalyDescriptor> double centeredTransformPass(P...
    method calculatePathDeviation (line 443) | double calculatePathDeviation(float[] point, int startPosition, int in...
    method constructUncertaintyBox (line 456) | protected <P extends AnomalyDescriptor> DiVector constructUncertaintyB...
    method withinGap (line 539) | protected boolean withinGap(DiVector gap, int startPosition, double[] ...
    method explainedByConditionalField (line 569) | protected <P extends AnomalyDescriptor> boolean explainedByConditional...
    method populateScores (line 595) | protected int populateScores(ScoringStrategy strategy, float[] point, ...
    method getCachedAttribution (line 621) | DiVector getCachedAttribution(int choice, float[] point, DiVector[] at...
    method getNewAttribution (line 638) | DiVector getNewAttribution(int choice, float[] point, RandomCutForest ...
    method getNewScore (line 654) | double getNewScore(int choice, float[] point, RandomCutForest forest) {
    method getThresholdAndGrade (line 677) | protected Weighted<Double> getThresholdAndGrade(ScoringStrategy strate...
    method saveScores (line 698) | protected void saveScores(ScoringStrategy strategy, int choice, double...
    method detect (line 730) | protected <P extends AnomalyDescriptor> P detect(P result, RCFComputeD...
    method setZfactor (line 980) | public void setZfactor(double factor) {
    method setAbsoluteThreshold (line 986) | public void setAbsoluteThreshold(double lower) {
    method setScoreDifferencing (line 991) | public void setScoreDifferencing(double persistence) {
    method setInitialThreshold (line 996) | public void setInitialThreshold(double initial) {
    method setNumberOfAttributors (line 1001) | public void setNumberOfAttributors(int numberOfAttributors) {
    method getNumberOfAttributors (line 1006) | public int getNumberOfAttributors() {
    method getLastScore (line 1010) | public double[] getLastScore() {
    method setLastScore (line 1014) | public void setLastScore(double[] score) {
    method validateIgnore (line 1020) | void validateIgnore(double[] shift, int length) {
    method setIgnoreNearExpectedFromAbove (line 1028) | public void setIgnoreNearExpectedFromAbove(double[] ignoreSimilarShift) {
    method setIgnoreNearExpectedFromBelow (line 1035) | public void setIgnoreNearExpectedFromBelow(double[] ignoreSimilarShift) {
    method setIgnoreNearExpectedFromAboveByRatio (line 1042) | public void setIgnoreNearExpectedFromAboveByRatio(double[] ignoreSimil...
    method setIgnoreNearExpectedFromBelowByRatio (line 1049) | public void setIgnoreNearExpectedFromBelowByRatio(double[] ignoreSimil...
    method setIgnoreNearExpected (line 1057) | public void setIgnoreNearExpected(double[] ignoreSimilarShift) {
    method getIgnoreNearExpected (line 1069) | public double[] getIgnoreNearExpected() {
    method getRandomSeed (line 1078) | public long getRandomSeed() {
    method getThresholders (line 1082) | public BasicThresholder[] getThresholders() {
    method getBaseDimension (line 1086) | public int getBaseDimension() {
    method getLastStrategy (line 1090) | public ScoringStrategy getLastStrategy() {
    method setLastStrategy (line 1094) | public void setLastStrategy(ScoringStrategy strategy) {
    method getDeviations (line 1098) | public Deviation[] getDeviations() {
    method getSamplingRate (line 1115) | public double getSamplingRate() {
    method setSamplingRate (line 1119) | public void setSamplingRate(double samplingRate) {
    method getModeInformation (line 1125) | public double[] getModeInformation() {
    method setModeInformation (line 1130) | public void setModeInformation(double[] modeInformation) {
    method isAutoAdjust (line 1133) | public boolean isAutoAdjust() {
    method setAutoAdjust (line 1137) | public void setAutoAdjust(boolean autoAdjust) {
    method getNoiseFactor (line 1141) | public double getNoiseFactor() {
    method setNoiseFactor (line 1145) | public void setNoiseFactor(double noiseFactor) {
    method setIgnoreDrift (line 1149) | public void setIgnoreDrift(boolean ignoreDrift) {
    method isIgnoreDrift (line 1153) | public boolean isIgnoreDrift() {
    method setLastDescriptor (line 1157) | public void setLastDescriptor(RCFComputeDescriptor lastDescriptor) {
    method getLastDescriptor (line 1161) | public RCFComputeDescriptor getLastDescriptor() {
    method getRunLength (line 1165) | public int getRunLength() {
    method setRunLength (line 1169) | public void setRunLength(int runLength) {
    method getSamplingSupport (line 1173) | public double getSamplingSupport() {
    method setSamplingSupport (line 1177) | public void setSamplingSupport(double sampling) {

FILE: Java/parkservices/src/main/java/com/amazon/randomcutforest/parkservices/RCFCaster.java
  class RCFCaster (line 41) | @Getter
    class Builder (line 54) | public static class Builder extends ThresholdedRandomCutForest.Builder...
      method Builder (line 67) | Builder() {
      method forecastHorizon (line 73) | public Builder forecastHorizon(int horizon) {
      method errorHorizon (line 78) | public Builder errorHorizon(int errorHorizon) {
      method percentile (line 83) | public Builder percentile(double percentile) {
      method calibration (line 88) | public Builder calibration(Calibration calibrationMethod) {
      method lowerLimit (line 93) | public Builder lowerLimit(float[] lowerLimit) {
      method upperLimit (line 98) | public Builder upperLimit(float[] upperLimit) {
      method useRCFCallibration (line 103) | public Builder useRCFCallibration(boolean use) {
      method build (line 108) | @Override
    method builder (line 130) | public static Builder builder() {
    method RCFCaster (line 134) | public RCFCaster(Builder builder) {
    method RCFCaster (line 149) | public RCFCaster(ForestMode forestMode, TransformMethod transformMetho...
    method process (line 169) | @Override
    method augment (line 174) | void augment(ForecastDescriptor answer) {
    method process (line 210) | @Override
    method calibrate (line 232) | public void calibrate(double[] actuals, Calibration calibration, Range...
    method extrapolate (line 236) | @Override
    method extrapolate (line 241) | public TimedRangeVector extrapolate(Calibration calibration, int horiz...
    method processSequentially (line 248) | @Override
    method processSequentially (line 263) | public List<AnomalyDescriptor> processSequentially(double[][] data, lo...
    method setUpperLimit (line 309) | public void setUpperLimit(float[] upperLimit) {
    method setLowerLimit (line 313) | public void setLowerLimit(float[] lowerLimit) {

FILE: Java/parkservices/src/main/java/com/amazon/randomcutforest/parkservices/SequentialAnalysis.java
  class SequentialAnalysis (line 30) | public class SequentialAnalysis {
    method detectAnomalies (line 50) | public static List<AnomalyDescriptor> detectAnomalies(double[][] data,...
    method detectAnomalies (line 65) | public static List<AnomalyDescriptor> detectAnomalies(double[][] data,...
    method detectAnomalies (line 71) | public static List<AnomalyDescriptor> detectAnomalies(double[][] data,...
    method forecastWithAnomalies (line 97) | public static AnalysisDescriptor forecastWithAnomalies(double[][] inpu...
    method forecastWithAnomalies (line 124) | public static AnalysisDescriptor forecastWithAnomalies(double[][] inpu...

FILE: Java/parkservices/src/main/java/com/amazon/randomcutforest/parkservices/ThresholdedRandomCutForest.java
  class ThresholdedRandomCutForest (line 68) | @Getter
    method ThresholdedRandomCutForest (line 88) | public ThresholdedRandomCutForest(Builder<?> builder) {
    method validateNonNegativeArray (line 158) | void validateNonNegativeArray(double[] array) {
    method ThresholdedRandomCutForest (line 167) | public ThresholdedRandomCutForest(ForestMode forestMode, TransformMeth...
    method ThresholdedRandomCutForest (line 195) | public ThresholdedRandomCutForest(RandomCutForest forest, double futur...
    method saveDescriptor (line 212) | protected <T extends AnomalyDescriptor> boolean saveDescriptor(T lastD...
    method augment (line 216) | protected <P extends AnomalyDescriptor> void augment(P description) {
    method process (line 234) | public AnomalyDescriptor process(double[] inputPoint, long timestamp) {
    method process (line 248) | public AnomalyDescriptor process(double[] inputPoint, long timestamp, ...
    method processSequentially (line 295) | public List<AnomalyDescriptor> processSequentially(double[][] data, Fu...
    method processSequentially (line 342) | public List<AnomalyDescriptor> processSequentially(double[][] data, lo...
    method processSequentially (line 397) | public List<AnomalyDescriptor> processSequentially(double[][] data) {
    method generateMissingIndicesArray (line 401) | private int[] generateMissingIndicesArray(double[] point) {
    method extrapolate (line 453) | public TimedRangeVector extrapolate(int horizon, boolean correct, doub...
    method extrapolate (line 484) | public TimedRangeVector extrapolate(int horizon) {
    method getForest (line 488) | public RandomCutForest getForest() {
    method setZfactor (line 492) | public void setZfactor(double factor) {
    method setLowerThreshold (line 496) | public void setLowerThreshold(double lower) {
    method setHorizon (line 500) | @Deprecated
    method setScoreDifferencing (line 505) | public void setScoreDifferencing(double scoreDifferencing) {
    method setIgnoreNearExpectedFromAbove (line 509) | public void setIgnoreNearExpectedFromAbove(double[] ignoreSimilarFromA...
    method setIgnoreNearExpectedFromAboveByRatio (line 513) | public void setIgnoreNearExpectedFromAboveByRatio(double[] ignoreSimil...
    method setIgnoreNearExpectedFromBelow (line 517) | public void setIgnoreNearExpectedFromBelow(double[] ignoreSimilarFromB...
    method setIgnoreNearExpectedFromBelowByRatio (line 521) | public void setIgnoreNearExpectedFromBelowByRatio(double[] ignoreSimil...
    method setScoringStrategy (line 525) | public void setScoringStrategy(ScoringStrategy strategy) {
    method setInitialThreshold (line 529) | @Deprecated
    method initialSetup (line 542) | <P extends AnomalyDescriptor> P initialSetup(P description, RCFCompute...
    method postProcess (line 567) | <P extends AnomalyDescriptor> void postProcess(P result) {
    method builder (line 668) | public static Builder<?> builder() {
    class Builder (line 672) | public static class Builder<T extends Builder<T>> {
      method validate (line 714) | void validate() {
      method build (line 759) | public ThresholdedRandomCutForest build() {
      method buildForest (line 764) | protected RandomCutForest buildForest() {
      method dimensions (line 788) | public T dimensions(int dimensions) {
      method sampleSize (line 793) | public T sampleSize(int sampleSize) {
      method startNormalization (line 798) | public T startNormalization(int startNormalization) {
      method stopNormalization (line 803) | public T stopNormalization(int stopNormalization) {
      method outputAfter (line 808) | public T outputAfter(int outputAfter) {
      method numberOfTrees (line 813) | public T numberOfTrees(int numberOfTrees) {
      method shingleSize (line 818) | public T shingleSize(int shingleSize) {
      method timeDecay (line 823) | public T timeDecay(double timeDecay) {
      method transformDecay (line 828) | public T transformDecay(double transformDecay) {
      method zFactor (line 833) | public T zFactor(double zFactor) {
      method useImputedFraction (line 838) | public T useImputedFraction(double fraction) {
      method randomSeed (line 843) | public T randomSeed(long randomSeed) {
      method centerOfMassEnabled (line 848) | public T centerOfMassEnabled(boolean centerOfMassEnabled) {
      method parallelExecutionEnabled (line 853) | public T parallelExecutionEnabled(boolean parallelExecutionEnabled) {
      method threadPoolSize (line 858) | public T threadPoolSize(int threadPoolSize) {
      method storeSequenceIndexesEnabled (line 863) | public T storeSequenceIndexesEnabled(boolean storeSequenceIndexesEna...
      method compact (line 868) | @Deprecated
      method internalShinglingEnabled (line 873) | public T internalShinglingEnabled(boolean internalShinglingEnabled) {
      method precision (line 878) | @De
Condensed preview — 391 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (9,752K chars).
[
  {
    "path": ".github/draft-release-notes-config.yml",
    "chars": 972,
    "preview": "# The overall template of the release notes\ntemplate: |\n  $CHANGES\n\n# Setting the formatting and sorting for the release"
  },
  {
    "path": ".github/workflows/draft-release-notes-workflow.yml",
    "chars": 447,
    "preview": "name: Release Drafter\n\non:\n  push:\n    branches:\n      - main\n\njobs:\n  update_release_draft:\n    name: Update draft rele"
  },
  {
    "path": ".github/workflows/maven-release.yml",
    "chars": 1942,
    "preview": "# This workflow will build a package using Maven and then publish it to\n# to our staging repo for a final release to mav"
  },
  {
    "path": ".github/workflows/maven-snapshot.yml",
    "chars": 1292,
    "preview": "name: Build and publish snapshot on push to main\non:\n  push:\n    branches:\n      - main\n\n\npermissions:\n  contents: read\n"
  },
  {
    "path": ".github/workflows/maven.yml",
    "chars": 421,
    "preview": "name: Java CI\n\non:\n  pull_request:\n    branches: \n      - '*'\n    paths:\n      - Java/**\n\n\npermissions:\n  contents: read"
  },
  {
    "path": ".github/workflows/rust.yml",
    "chars": 398,
    "preview": "name: Rust CI\n\non:\n  pull_request:\n    branches: [ main ]\n    paths: [ Rust/** ]\n\n\npermissions:\n  contents: read\n\nenv:\n "
  },
  {
    "path": ".gitignore",
    "chars": 90,
    "preview": "build\ntarget\n.idea\n*.iml\n.project\n.settings\n.classpath\n._.DS_Store\n.DS_Store\nJava/*/bin/\n\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 309,
    "preview": "## Code of Conduct\nThis project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-condu"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 3306,
    "preview": "# Contributing Guidelines\n\nThank you for your interest in contributing to our project. Whether it's a bug report, new fe"
  },
  {
    "path": "Java/README.md",
    "chars": 18177,
    "preview": "# Random Cut Forest\n\nThis directory contains a Java implementation of the Random Cut Forest data structure and algorithm"
  },
  {
    "path": "Java/RELEASING.md",
    "chars": 1171,
    "preview": "- [Overview](#overview)\n- [Feature Branches](#feature-branches)\n- [Release Labels](#release-labels)\n- [Releasing](#relea"
  },
  {
    "path": "Java/benchmark/pom.xml",
    "chars": 2801,
    "preview": "<?xml version=\"1.0\"?>\n<project xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4"
  },
  {
    "path": "Java/benchmark/src/main/java/com/amazon/randomcutforest/RandomCutForestBenchmark.java",
    "chars": 6452,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/benchmark/src/main/java/com/amazon/randomcutforest/RandomCutForestShingledBenchmark.java",
    "chars": 6885,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/benchmark/src/main/java/com/amazon/randomcutforest/StateMapperBenchmark.java",
    "chars": 7310,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/benchmark/src/main/java/com/amazon/randomcutforest/StateMapperShingledBenchmark.java",
    "chars": 8801,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/benchmark/src/main/java/com/amazon/randomcutforest/profilers/ObjectGraphSizeProfiler.java",
    "chars": 2112,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/benchmark/src/main/java/com/amazon/randomcutforest/profilers/OutputSizeProfiler.java",
    "chars": 2197,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/pom.xml",
    "chars": 2231,
    "preview": "<?xml version=\"1.0\"?>\n<project xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/CommonUtils.java",
    "chars": 10019,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/ComponentList.java",
    "chars": 1427,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/IComponentModel.java",
    "chars": 1155,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/IMultiVisitorFactory.java",
    "chars": 895,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/IVisitorFactory.java",
    "chars": 885,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/MultiVisitor.java",
    "chars": 2092,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/MultiVisitorFactory.java",
    "chars": 1956,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/PredictiveRandomCutForest.java",
    "chars": 27094,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/RandomCutForest.java",
    "chars": 77227,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/Visitor.java",
    "chars": 2957,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/VisitorFactory.java",
    "chars": 1694,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/AbstractAttributionVisitor.java",
    "chars": 11418,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/AbstractScalarScoreVisitor.java",
    "chars": 10696,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/AnomalyAttributionVisitor.java",
    "chars": 2379,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/AnomalyScoreVisitor.java",
    "chars": 2880,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/DynamicAttributionVisitor.java",
    "chars": 3307,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/DynamicScoreVisitor.java",
    "chars": 3361,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/SimulatedTransductiveScalarScoreVisitor.java",
    "chars": 3422,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/anomalydetection/TransductiveScalarScoreVisitor.java",
    "chars": 7400,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/config/Config.java",
    "chars": 813,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/config/ForestMode.java",
    "chars": 1430,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/config/IDynamicConfig.java",
    "chars": 1711,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/config/ImputationMethod.java",
    "chars": 1251,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/config/Precision.java",
    "chars": 888,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/config/TransformMethod.java",
    "chars": 1660,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/executor/AbstractForestTraversalExecutor.java",
    "chars": 8494,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/executor/AbstractForestUpdateExecutor.java",
    "chars": 4103,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/executor/AbstractUpdateCoordinator.java",
    "chars": 1456,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/executor/IStateCoordinator.java",
    "chars": 2626,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/executor/ITraversable.java",
    "chars": 4076,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/executor/IUpdatable.java",
    "chars": 1049,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/executor/ParallelForestTraversalExecutor.java",
    "chars": 4131,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/executor/ParallelForestUpdateExecutor.java",
    "chars": 2125,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/executor/PointStoreCoordinator.java",
    "chars": 2094,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/executor/SamplerPlusTree.java",
    "chars": 5305,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/executor/SequentialForestTraversalExecutor.java",
    "chars": 3183,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/executor/SequentialForestUpdateExecutor.java",
    "chars": 1548,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/executor/UpdateResult.java",
    "chars": 3201,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/imputation/ConditionalSampleSummarizer.java",
    "chars": 8533,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/imputation/ImputeVisitor.java",
    "chars": 9969,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/inputtypes/Point.java",
    "chars": 1305,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/inspect/NearNeighborVisitor.java",
    "chars": 4008,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/interpolation/SimpleInterpolationVisitor.java",
    "chars": 10609,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/IPreprocessor.java",
    "chars": 2134,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/ImputePreprocessor.java",
    "chars": 22187,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/InitialSegmentPreprocessor.java",
    "chars": 9455,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/Preprocessor.java",
    "chars": 47446,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/transform/DifferenceTransformer.java",
    "chars": 3602,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/transform/ITransformer.java",
    "chars": 3811,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/transform/NormalizedDifferenceTransformer.java",
    "chars": 4777,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/transform/NormalizedTransformer.java",
    "chars": 1280,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/transform/SubtractMATransformer.java",
    "chars": 1073,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/preprocessor/transform/WeightedTransformer.java",
    "chars": 10019,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/returntypes/ConditionalTreeSample.java",
    "chars": 3099,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/returntypes/ConvergingAccumulator.java",
    "chars": 1578,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/returntypes/DensityOutput.java",
    "chars": 4513,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/returntypes/DiVector.java",
    "chars": 6716,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/returntypes/InterpolationMeasure.java",
    "chars": 6542,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/returntypes/Neighbor.java",
    "chars": 5655,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/returntypes/OneSidedConvergingDiVectorAccumulator.java",
    "chars": 2991,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/returntypes/OneSidedConvergingDoubleAccumulator.java",
    "chars": 2748,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/returntypes/OneSidedStDevAccumulator.java",
    "chars": 7090,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/returntypes/RangeVector.java",
    "chars": 3675,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/returntypes/SampleSummary.java",
    "chars": 9171,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/returntypes/TimedRangeVector.java",
    "chars": 4656,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/runner/AnomalyAttributionRunner.java",
    "chars": 3565,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/runner/AnomalyScoreRunner.java",
    "chars": 2787,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/runner/ArgumentParser.java",
    "chars": 13004,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/runner/ImputeRunner.java",
    "chars": 3929,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/runner/LineTransformer.java",
    "chars": 1893,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/runner/SimpleDensityRunner.java",
    "chars": 3609,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/runner/SimpleRunner.java",
    "chars": 7947,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/runner/UpdateOnlyTransformer.java",
    "chars": 1521,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/sampler/AbstractStreamSampler.java",
    "chars": 10888,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/sampler/AcceptPointState.java",
    "chars": 1177,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/sampler/CompactSampler.java",
    "chars": 14227,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/sampler/ISampled.java",
    "chars": 1168,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/sampler/IStreamSampler.java",
    "chars": 5417,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/sampler/Weighted.java",
    "chars": 1232,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/ExecutionContext.java",
    "chars": 1072,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/IContextualStateMapper.java",
    "chars": 937,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/IStateMapper.java",
    "chars": 845,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/PredictiveRandomCutForestMapper.java",
    "chars": 3051,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/PredictiveRandomCutForestState.java",
    "chars": 1177,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/RandomCutForestMapper.java",
    "chars": 14813,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/RandomCutForestState.java",
    "chars": 2238,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/Version.java",
    "chars": 1025,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/preprocessor/PreprocessorMapper.java",
    "chars": 5573,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/preprocessor/PreprocessorState.java",
    "chars": 2050,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/returntypes/DiVectorMapper.java",
    "chars": 1525,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/returntypes/DiVectorState.java",
    "chars": 1485,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/sampler/CompactSamplerMapper.java",
    "chars": 3919,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/sampler/CompactSamplerState.java",
    "chars": 2403,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/statistics/DeviationMapper.java",
    "chars": 2266,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/statistics/DeviationState.java",
    "chars": 954,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/store/NodeStoreState.java",
    "chars": 1464,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/store/PointStoreMapper.java",
    "chars": 6545,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/store/PointStoreState.java",
    "chars": 3078,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/tree/AbstractNodeStoreMapper.java",
    "chars": 8977,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/tree/CompactRandomCutTreeContext.java",
    "chars": 948,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/tree/CompactRandomCutTreeState.java",
    "chars": 1472,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/state/tree/RandomCutTreeMapper.java",
    "chars": 4150,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/statistics/Deviation.java",
    "chars": 3017,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/store/IPointStore.java",
    "chars": 1999,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/store/IPointStoreView.java",
    "chars": 3085,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/store/IndexIntervalManager.java",
    "chars": 6008,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/store/PointStore.java",
    "chars": 31533,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/store/PointStoreLarge.java",
    "chars": 2380,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/store/PointStoreSmall.java",
    "chars": 3196,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/store/StreamSampler.java",
    "chars": 9383,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/summarization/Center.java",
    "chars": 6940,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/summarization/GenericMultiCenter.java",
    "chars": 10687,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/summarization/ICluster.java",
    "chars": 4625,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/summarization/MultiCenter.java",
    "chars": 3132,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/summarization/Summarizer.java",
    "chars": 30417,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/tree/AbstractNodeStore.java",
    "chars": 8102,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/tree/BoundingBox.java",
    "chars": 8017,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/tree/Cut.java",
    "chars": 2957,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/tree/HyperTree.java",
    "chars": 5823,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/tree/IBoundingBoxView.java",
    "chars": 1074,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/tree/INodeView.java",
    "chars": 1729,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/tree/ITree.java",
    "chars": 1598,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/tree/NodeStoreLarge.java",
    "chars": 7212,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/tree/NodeStoreMedium.java",
    "chars": 7626,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/tree/NodeStoreSmall.java",
    "chars": 7823,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/tree/NodeView.java",
    "chars": 3709,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/tree/RandomCutTree.java",
    "chars": 43464,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/util/ArrayPacking.java",
    "chars": 17976,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/util/ArrayUtils.java",
    "chars": 1590,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/util/ShingleBuilder.java",
    "chars": 6347,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/main/java/com/amazon/randomcutforest/util/Weighted.java",
    "chars": 4131,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/AttributionExamplesFunctionalTest.java",
    "chars": 14924,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/CPUTest.java",
    "chars": 6803,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/ConditionalFieldTest.java",
    "chars": 5443,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/DynamicPointSetFunctionalTest.java",
    "chars": 7467,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/ForecastTest.java",
    "chars": 4652,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/MultiCenterTest.java",
    "chars": 12696,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/PredictiveRandomCutForestTest.java",
    "chars": 16105,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/RandomCutForestBuilderTest.java",
    "chars": 9826,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/RandomCutForestConsistencyFunctionalTest.java",
    "chars": 8491,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/RandomCutForestFunctionalTest.java",
    "chars": 28654,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/RandomCutForestShingledFunctionalTest.java",
    "chars": 23196,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/RandomCutForestTest.java",
    "chars": 51350,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/SampleSummaryTest.java",
    "chars": 26418,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/TestUtils.java",
    "chars": 4675,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/anomalydetection/AnomalyAttributionVisitorTest.java",
    "chars": 13517,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/anomalydetection/AnomalyScoreVisitorTest.java",
    "chars": 13141,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/anomalydetection/DynamicAttributionVisitorTest.java",
    "chars": 1519,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/anomalydetection/DynamicScoreVisitorTest.java",
    "chars": 1501,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/executor/ForestTraversalExecutorTest.java",
    "chars": 11323,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/executor/ForestUpdateExecutorTest.java",
    "chars": 6664,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/executor/PointStoreCoordinatorTest.java",
    "chars": 3511,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/executor/SamplerPlusTreeTest.java",
    "chars": 4317,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/executor/UpdateResultTest.java",
    "chars": 1038,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/imputation/ConditionalSampleSummarizerTest.java",
    "chars": 3684,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/imputation/ImputeVisitorTest.java",
    "chars": 9104,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/inspect/NearNeighborVisitorTest.java",
    "chars": 5139,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/interpolation/SimpleInterpolationVisitorTest.java",
    "chars": 14071,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/preprocessor/PreprocessorTest.java",
    "chars": 31016,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/preprocessor/transform/WeightedTransformerTest.java",
    "chars": 4601,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/returntypes/DensityOutputTest.java",
    "chars": 6051,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/returntypes/DiVectorTest.java",
    "chars": 6041,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/returntypes/InterpolationMeasureTest.java",
    "chars": 6765,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/returntypes/NeighborTest.java",
    "chars": 1509,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/returntypes/OneSidedConvergingDiVectorTest.java",
    "chars": 3071,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/returntypes/OneSidedConvergingDoubleAccumulatorTest.java",
    "chars": 4639,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/returntypes/RangeVectorTest.java",
    "chars": 4329,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/returntypes/SampleSummaryTest.java",
    "chars": 6381,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/returntypes/TimedRangeVectorTest.java",
    "chars": 4761,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/runner/AnomalyAttributionRunnerTest.java",
    "chars": 3927,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/runner/AnomalyScoreRunnerTest.java",
    "chars": 3501,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/runner/ArgumentParserTest.java",
    "chars": 2650,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/runner/ImputeRunnerTest.java",
    "chars": 2757,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/runner/SimpleDensityRunnerTest.java",
    "chars": 4289,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/runner/UpdateOnlyTransformerTest.java",
    "chars": 1699,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/sampler/CompactSamplerTest.java",
    "chars": 16000,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/state/RandomCutForestMapperTest.java",
    "chars": 13608,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/state/V2PreProcessorJsonResource.java",
    "chars": 961,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/state/V2RCFJsonResource.java",
    "chars": 895,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/state/sampler/CompactSamplerMapperTest.java",
    "chars": 5916,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  },
  {
    "path": "Java/core/src/test/java/com/amazon/randomcutforest/state/store/PointStoreMapperTest.java",
    "chars": 2540,
    "preview": "/*\n * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, V"
  }
]

// ... and 191 more files (download for full content)

About this extraction

This page contains the full source code of the aws/random-cut-forest-by-aws GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 391 files (8.9 MB), approximately 2.4M tokens, and a symbol index with 3627 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!