Search in sources :

Example 6 with Deviation

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;
}
Also used : Deviation(com.amazon.randomcutforest.parkservices.statistics.Deviation)

Aggregations

Deviation (com.amazon.randomcutforest.parkservices.statistics.Deviation)6 DeviationMapper (com.amazon.randomcutforest.parkservices.state.statistics.DeviationMapper)3 Preprocessor (com.amazon.randomcutforest.parkservices.preprocessor.Preprocessor)1 DeviationState (com.amazon.randomcutforest.parkservices.state.statistics.DeviationState)1 BasicThresholder (com.amazon.randomcutforest.parkservices.threshold.BasicThresholder)1