protected static String toLogStr(Params params, double accuracy, double error) { StringBuffer sb = new StringBuffer(); sb.append("strategy ").append(params.getNrStartegy().toString()).append(COMMA); sb.append("window ").append(params.getWindowSize()).append(COMMA); sb.append("PAA ").append(params.getPaaSize()).append(COMMA); sb.append("alphabet ").append(params.getAlphabetSize()).append(COMMA); sb.append(" accuracy ").append(fmt.format(accuracy)).append(COMMA); sb.append(" error ").append(fmt.format(error)); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + alphabetSize; long temp; temp = Double.doubleToLongBits(cvError); result = prime * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(nThreshold); result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + ((nrStartegy == null) ? 0 : nrStartegy.hashCode()); result = prime * result + paaSize; result = prime * result + windowSize; return result; }
.fromValue(numRedStrategy.index()); if (NumerosityReductionStrategy.MINDIST.equals(nrStrategy)) { LOGGER.warn( "Unable to run with {} numerosity reduction stategy in parallel -- rolling back to NONE implementation and post-pruning.", if (0 == res.size() || nrStrategy.equals(NumerosityReductionStrategy.NONE)) { res.addAll(chunkRes); completedChunks[idx] = COMPLETED_FLAG; if (nrStrategy.equals(NumerosityReductionStrategy.NONE)) { LOGGER.debug("merged in as is because the NR strategy is NONE"); if (nrStrategy.equals(NumerosityReductionStrategy.EXACT) && headStr.equalsIgnoreCase(tailStr)) { LOGGER.debug("res head {} at {} is dropped in favor of head tail {} at {}", if (nrStrategy.equals(NumerosityReductionStrategy.EXACT) && resStr.equalsIgnoreCase(headStr)) { LOGGER.debug("chunk head {} at {} is dropped in favor of res tail {} at {}", if (nrStrategy.equals(NumerosityReductionStrategy.EXACT) && resStr.equalsIgnoreCase(headStr)) { LOGGER.debug("chunk head {} at {} is dropped in favor of res tail {} at {}", if (nrStrategy.equals(NumerosityReductionStrategy.EXACT) && headStr.equalsIgnoreCase(tailStr)) { LOGGER.debug("chunk head {} at {} is dropped in favor of res tail {} at {}", if (NumerosityReductionStrategy.MINDIST.equals(numRedStrategy)) {
else if (NumerosityReductionStrategy.NONE.toString().equalsIgnoreCase(command) || NumerosityReductionStrategy.EXACT.toString().equalsIgnoreCase(command) || NumerosityReductionStrategy.MINDIST.toString().equalsIgnoreCase(command)) { log(Level.INFO, "numerosity reduction option toggled"); this.controller.getSession().numerosityReductionStrategy = NumerosityReductionStrategy .fromString(command);
@SuppressWarnings("unused") SAXRecords sequentialRes = sp.ts2saxViaWindow(ts, slidingWindowSize, paaSize, na.getCuts(alphabetSize), NumerosityReductionStrategy.fromString(nrStrategy), N_THRESHOLD); @SuppressWarnings("unused") SAXRecords parallelRes = ps.process(ts, threadsNum, slidingWindowSize, paaSize, alphabetSize, NumerosityReductionStrategy.fromString(nrStrategy), N_THRESHOLD);
ALPHABET_SIZE = Integer.valueOf(args[4]); STRATEGY = NumerosityReductionStrategy.valueOf(args[5].toUpperCase());
.fromValue(numRedStrategy.index()); if (NumerosityReductionStrategy.MINDIST.equals(nrStrategy)) { LOGGER.warn( "Unable to run with {} numerosity reduction stategy in parallel -- rolling back to NONE implementation and post-pruning.", if (0 == res.size() || nrStrategy.equals(NumerosityReductionStrategy.NONE)) { res.addAll(chunkRes); completedChunks[idx] = COMPLETED_FLAG; if (nrStrategy.equals(NumerosityReductionStrategy.NONE)) { LOGGER.debug("merged in as is because the NR strategy is NONE"); if (nrStrategy.equals(NumerosityReductionStrategy.EXACT) && headStr.equalsIgnoreCase(tailStr)) { LOGGER.debug("res head {} at {} is dropped in favor of head tail {} at {}", if (nrStrategy.equals(NumerosityReductionStrategy.EXACT) && resStr.equalsIgnoreCase(headStr)) { LOGGER.debug("chunk head {} at {} is dropped in favor of res tail {} at {}", if (nrStrategy.equals(NumerosityReductionStrategy.EXACT) && resStr.equalsIgnoreCase(headStr)) { LOGGER.debug("chunk head {} at {} is dropped in favor of res tail {} at {}", if (nrStrategy.equals(NumerosityReductionStrategy.EXACT) && headStr.equalsIgnoreCase(tailStr)) { LOGGER.debug("chunk head {} at {} is dropped in favor of res tail {} at {}", if (NumerosityReductionStrategy.MINDIST.equals(numRedStrategy)) {
@SuppressWarnings("unused") SAXRecords sequentialRes = sp.ts2saxViaWindow(ts, slidingWindowSize, paaSize, na.getCuts(alphabetSize), NumerosityReductionStrategy.fromString(nrStrategy), N_THRESHOLD); @SuppressWarnings("unused") SAXRecords parallelRes = ps.process(ts, threadsNum, slidingWindowSize, paaSize, alphabetSize, NumerosityReductionStrategy.fromString(nrStrategy), N_THRESHOLD);
protected static String toLogStr(Params params, double accuracy, double error) { StringBuffer sb = new StringBuffer(); sb.append("error ").append(fmt.format(error)).append(COMMA); sb.append("params: strategy ").append(params.getNrStartegy().toString()).append(COMMA); sb.append("window ").append(params.getWindowSize()).append(COMMA); sb.append("PAA ").append(params.getPaaSize()).append(COMMA); sb.append("alphabet ").append(params.getAlphabetSize()).append(COMMA); sb.append("( CV error ").append(fmt.format(params.getCvError())).append(")"); return sb.toString(); }
protected static String toParserString(Params params, double accuracy, double error) { StringBuffer sb = new StringBuffer("#"); sb.append(SAXVSMDirectSamplerParams.TRAIN_FILE).append(COMMA); sb.append(fmt.format(error)).append(COMMA); sb.append(params.getNrStartegy().toString()).append(COMMA); sb.append(params.getWindowSize()).append(COMMA); sb.append(params.getPaaSize()).append(COMMA); sb.append(params.getAlphabetSize()).append(COMMA); sb.append(fmt.format(params.getCvError())); return sb.toString(); }
if (NumerosityReductionStrategy.EXACT.equals(this.numerosityReductionStrategy) && Arrays.equals(previousString, currentString)) {
"running sampling for " + NumerosityReductionStrategy.MINDIST.toString() + " strategy..."); Params classicParams = sample(NumerosityReductionStrategy.MINDIST); "running sampling for " + NumerosityReductionStrategy.EXACT.toString() + " strategy..."); Params exactParams = sample(NumerosityReductionStrategy.EXACT); "running sampling for " + NumerosityReductionStrategy.NONE.toString() + " strategy..."); Params noredParams = sample(NumerosityReductionStrategy.NONE); Date finish = new Date();
if (NumerosityReductionStrategy.EXACT.equals(this.numerosityReductionStrategy) && Arrays.equals(previousString, currentString)) {
numerosityReductionPane.setLayout(numerosityPaneLayout); numerosityReductionOFFButton.setActionCommand(NumerosityReductionStrategy.NONE.toString()); numerosityButtonsGroup.add(numerosityReductionOFFButton); numerosityReductionOFFButton.addActionListener(this); numerosityReductionPane.add(numerosityReductionOFFButton); numerosityReductionExactButton.setActionCommand(NumerosityReductionStrategy.EXACT.toString()); numerosityButtonsGroup.add(numerosityReductionExactButton); numerosityReductionExactButton.addActionListener(this); .setActionCommand(NumerosityReductionStrategy.MINDIST.toString()); numerosityButtonsGroup.add(numerosityReductionMINDISTButton); numerosityReductionMINDISTButton.addActionListener(this);
+ ", A " + SAX_ALPHABET_SIZE + ", STR " + SAX_NR_STRATEGY.toString();
+ ", A " + SAX_ALPHABET_SIZE + ", STR " + SAX_NR_STRATEGY.toString();