Search in sources :

Example 1 with DeviationState

use of com.amazon.randomcutforest.parkservices.state.statistics.DeviationState in project random-cut-forest-by-aws by aws.

the class PreprocessorMapper method toState.

@Override
public PreprocessorState toState(Preprocessor model) {
    PreprocessorState state = new PreprocessorState();
    state.setShingleSize(model.getShingleSize());
    state.setDimensions(model.getDimension());
    state.setInputLength(model.getInputLength());
    state.setClipFactor(model.getClipFactor());
    state.setDefaultFill(model.getDefaultFill());
    state.setImputationMethod(model.getImputationMethod().name());
    state.setTransformMethod(model.getTransformMethod().name());
    state.setWeights(model.getWeights());
    state.setForestMode(model.getMode().name());
    state.setInitialTimeStamps(model.getInitialTimeStamps());
    state.setInitialValues(model.getInitialValues());
    state.setUseImputedFraction(model.getUseImputedFraction());
    state.setNormalizeTime(model.isNormalizeTime());
    state.setStartNormalization(model.getStartNormalization());
    state.setStopNormalization(model.getStopNormalization());
    state.setPreviousTimeStamps(model.getPreviousTimeStamps());
    state.setLastShingledInput(model.getLastShingledInput());
    state.setLastShingledPoint(model.getLastShingledPoint());
    state.setValuesSeen(model.getValuesSeen());
    state.setInternalTimeStamp(model.getInternalTimeStamp());
    DeviationMapper deviationMapper = new DeviationMapper();
    state.setTimeStampDeviationState(deviationMapper.toState(model.getTimeStampDeviation()));
    state.setDataQualityState(deviationMapper.toState(model.getDataQuality()));
    DeviationState[] deviationStates = null;
    if (model.getDeviationList() != null) {
        Deviation[] list = model.getDeviationList();
        deviationStates = new DeviationState[list.length];
        for (int i = 0; i < list.length; i++) {
            deviationStates[i] = deviationMapper.toState(list[i]);
        }
    }
    state.setDeviationStates(deviationStates);
    return state;
}
Also used : DeviationMapper(com.amazon.randomcutforest.parkservices.state.statistics.DeviationMapper) DeviationState(com.amazon.randomcutforest.parkservices.state.statistics.DeviationState) Deviation(com.amazon.randomcutforest.parkservices.statistics.Deviation)

Aggregations

DeviationMapper (com.amazon.randomcutforest.parkservices.state.statistics.DeviationMapper)1 DeviationState (com.amazon.randomcutforest.parkservices.state.statistics.DeviationState)1 Deviation (com.amazon.randomcutforest.parkservices.statistics.Deviation)1