use of com.amazon.randomcutforest.parkservices.statistics.Deviation in project random-cut-forest-by-aws by aws.
the class InitialSegmentPreprocessor method dischargeInitial.
/**
* a block which executes once; it first computes the multipliers for
* normalization and then processes each of the stored inputs
*/
protected void dischargeInitial(RandomCutForest forest) {
Deviation tempTimeDeviation = new Deviation();
for (int i = 0; i < initialTimeStamps.length - 1; i++) {
tempTimeDeviation.update(initialTimeStamps[i + 1] - initialTimeStamps[i]);
}
double timeFactor = tempTimeDeviation.getDeviation();
double[] factors = getFactors();
for (int i = 0; i < valuesSeen; i++) {
double[] scaledInput = getScaledInput(initialValues[i], initialTimeStamps[i], factors, timeFactor);
updateState(initialValues[i], scaledInput, initialTimeStamps[i], previousTimeStamps[shingleSize - 1]);
dataQuality.update(1.0);
forest.update(scaledInput);
}
initialTimeStamps = null;
initialValues = null;
}
Aggregations