docs: private int getMinErrorRateWindowSizeIncremental() {
  		int numSamples = this.stm.numInstances();
  		if (numSamples < 2 * this.minSTMSizeOption.getValue()) {
  			return numSamples;
  		} else {
  			List<Integer> numSamplesRange = new ArrayList<>();
  			numSamplesRange.add(numSamples);
  			while (numSamplesRange.get(numSamplesRange.size() - 1) >= 2 * this.minSTMSizeOption.getValue())
  				numSamplesRange.add(numSamplesRange.get(numSamplesRange.size() - 1) / 2);
  			List<Double> errorRates = new ArrayList<>();
  			for (Integer numSamplesIt : numSamplesRange) {
  				int idx = numSamples - numSamplesIt;
  				List<Integer> predHistory;
  				if (this.predictionHistories.containsKey(idx)) {
  					predHistory = this.getIncrementalTestTrainPredHistory(this.stm, idx, this.predictionHistories.get(idx));
  				} else if (this.predictionHistories.containsKey(idx-1)){
  					predHistory = this.predictionHistories.remove(idx-1);
  					predHistory.remove(0);
  					predHistory = this.getIncrementalTestTrainPredHistory(this.stm, idx, predHistory);
  					this.predictionHistories.put(idx, predHistory);
  				} else {
  					predHistory = this.getTestTrainPredHistory(this.stm, idx);
  					this.predictionHistories.put(idx, predHistory);
  				}
  				errorRates.add(this.getHistoryErrorRate(predHistory));
  			}
  			int minErrorRateIdx = errorRates.indexOf(Collections.min(errorRates));
  			if (minErrorRateIdx > 0) {
  				for (int i = 1; i < errorRates.size(); i++){
  					if (errorRates.get(i) < errorRates.get(0)){
  						int idx = numSamples - numSamplesRange.get(i);
  						List<Integer> predHistory = this.getTestTrainPredHistory(this.stm, idx);
  						errorRates.set(i, this.getHistoryErrorRate(predHistory));
  						this.predictionHistories.remove(idx);
  						this.predictionHistories.put(idx, predHistory);
  					}
  				}
  				minErrorRateIdx = errorRates.indexOf(Collections.min(errorRates));
  			}
  			int windowSize = numSamplesRange.get(minErrorRateIdx);
  			if (windowSize < numSamples) {
  				this.adaptHistories(minErrorRateIdx);
  			}
  			return windowSize;
  		}
  	}