private static SAXRecords discretize(double[] series) throws SAXException { consoleLogger.info("Performing SAX conversion ..."); if (TS2GrammarParameters.NUM_WORKERS <= 1) { return sp.ts2saxViaWindow(series, TS2GrammarParameters.SAX_WINDOW_SIZE, TS2GrammarParameters.SAX_PAA_SIZE, na.getCuts(TS2GrammarParameters.SAX_ALPHABET_SIZE), TS2GrammarParameters.SAX_NR_STRATEGY, TS2GrammarParameters.SAX_NORM_THRESHOLD); } else { return psax.process(series, TS2GrammarParameters.NUM_WORKERS, TS2GrammarParameters.SAX_WINDOW_SIZE, TS2GrammarParameters.SAX_PAA_SIZE, TS2GrammarParameters.SAX_ALPHABET_SIZE, TS2GrammarParameters.SAX_NR_STRATEGY, TS2GrammarParameters.SAX_NORM_THRESHOLD); } }
SAXRecords saxData = ts2saxViaWindow(series, windowSize, paaSize, na.getCuts(alphabetSize), strategy, nrThreshold);
SAXRecords saxData = ts2saxViaWindow(series, windowSize, paaSize, na.getCuts(alphabetSize), strategy, nrThreshold);
res = sp.ts2saxViaWindow(ts, slidingWindowSize, paaSize, na.getCuts(alphabetSize), nrStrategy, nThreshold);
res = sp.ts2saxViaWindow(ts, slidingWindowSize, paaSize, na.getCuts(alphabetSize), nrStrategy, nThreshold);
char[] currentString = tsp.ts2String(paa, na.getCuts(this.saxAlphabetSize));
char[] currentString = tsp.ts2String(paa, na.getCuts(this.saxAlphabetSize));
SAXRecords sax = sp.ts2saxViaWindow(series, windowSize, paaSize, normalA.getCuts(alphabetSize), strategy, nThreshold); Date saxEnd = new Date();
normalA.getCuts(alphabetSize), strategy, nThreshold); Date saxEnd = new Date(); LOGGER.debug("discretized in {}, words: {}, indexes: {}",
normalA.getCuts(alphabetSize), strategy, nThreshold); Date saxEnd = new Date(); LOGGER.debug("discretized in {}, words: {}, indexes: {}",
@SuppressWarnings("unused") SAXRecords sequentialRes = sp.ts2saxViaWindow(ts, slidingWindowSize, paaSize, na.getCuts(alphabetSize), NumerosityReductionStrategy.fromString(nrStrategy), N_THRESHOLD);
SAXRecords sax = sp.ts2saxViaWindow(series, windowSize, paaSize, normalA.getCuts(alphabetSize), strategy, nThreshold); Date saxEnd = new Date();
@SuppressWarnings("unused") SAXRecords sequentialRes = sp.ts2saxViaWindow(ts, slidingWindowSize, paaSize, na.getCuts(alphabetSize), NumerosityReductionStrategy.fromString(nrStrategy), N_THRESHOLD);
public static void main(String[] args) throws IOException, SAXException { double[] ts = { 0, 0, 0, 0, 0, -0.270340178359072, -0.367828308500142, 0.666980581124872, 1.87088147328446, 2.14548907684624, -0.480859313143032, -0.72911654245842, -0.490308602315934, -0.66152028906509, -0.221049033806403, 0.367003418871239, 0.631073992586373, 0.0487728723414486, 0.762655178750436, 0.78574757843331, 0.338239686422963, 0.784206454089066, -2.14265084073625, 2.11325193044223, 0.186018356196443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.519132472499234, -2.604783141655, -0.244519550114012, -1.6570790528784, 3.34184602886343, 2.10361226260999, 1.9796808733979, -0.822247322003058, 1.06850578033292, -0.678811824405992, 0.804225748913681, 0.57363964388698, 0.437113583759113, 0.437208643628268, 0.989892093383503, 1.76545983424176, 0.119483882364649, -0.222311941138971, -0.74669456611669, -0.0663660879732063, 0, 0, 0, 0, 0 }; SAXProcessor sp = new SAXProcessor(); NormalAlphabet na = new NormalAlphabet(); SAXRecords saxExact = sp.ts2saxViaWindow(ts, 30, 3, na.getCuts(3), NumerosityReductionStrategy.EXACT, 0.01); saxExact.buildIndex(); for (int i : saxExact.getAllIndices()) { System.out.println(i + " -> " + saxExact.getByIndex(i)); } System.out.println(" ===================== "); SAXRecords saxMindist = sp.ts2saxViaWindow(ts, 30, 6, na.getCuts(5), NumerosityReductionStrategy.MINDIST, 0.01); saxExact.buildIndex(); for (int i : saxMindist.getAllIndices()) { System.out.println(i + " -> " + saxMindist.getByIndex(i)); } }
public static void main(String[] args) throws IOException, SAXException { double[] ts = { 0, 0, 0, 0, 0, -0.270340178359072, -0.367828308500142, 0.666980581124872, 1.87088147328446, 2.14548907684624, -0.480859313143032, -0.72911654245842, -0.490308602315934, -0.66152028906509, -0.221049033806403, 0.367003418871239, 0.631073992586373, 0.0487728723414486, 0.762655178750436, 0.78574757843331, 0.338239686422963, 0.784206454089066, -2.14265084073625, 2.11325193044223, 0.186018356196443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.519132472499234, -2.604783141655, -0.244519550114012, -1.6570790528784, 3.34184602886343, 2.10361226260999, 1.9796808733979, -0.822247322003058, 1.06850578033292, -0.678811824405992, 0.804225748913681, 0.57363964388698, 0.437113583759113, 0.437208643628268, 0.989892093383503, 1.76545983424176, 0.119483882364649, -0.222311941138971, -0.74669456611669, -0.0663660879732063, 0, 0, 0, 0, 0 }; SAXProcessor sp = new SAXProcessor(); NormalAlphabet na = new NormalAlphabet(); SAXRecords saxExact = sp.ts2saxViaWindow(ts, 30, 3, na.getCuts(3), NumerosityReductionStrategy.EXACT, 0.01); saxExact.buildIndex(); for (int i : saxExact.getAllIndices()) { System.out.println(i + " -> " + saxExact.getByIndex(i)); } System.out.println(" ===================== "); SAXRecords saxMindist = sp.ts2saxViaWindow(ts, 30, 6, na.getCuts(5), NumerosityReductionStrategy.MINDIST, 0.01); saxExact.buildIndex(); for (int i : saxMindist.getAllIndices()) { System.out.println(i + " -> " + saxMindist.getByIndex(i)); } }
String sax = String.valueOf(tp.ts2String( tp.paa(tp.znorm(tp.subseriesByCopy(series, i, i + motifSize), znormThreshold), paaSize), normalA.getCuts(alphabetSize))); if (null == buckets.get(sax)) { buckets.put(sax, new ArrayList<Integer>());
double[] cuts = na.getCuts(alphabetSize);
double[] cuts = na.getCuts(alphabetSize);
char[] currentString = tp.ts2String(paa, normalA.getCuts(A_SIZE));