MCPcopy Index your code
hub / github.com/DynamicTimeWarping/dtw-python / get

Method get

dtw/stepPattern.py:413–443  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

411 return self
412
413 def get(self): # eqv to .Pend
414 ia = numpy.array(self.i, dtype=numpy.double)
415 ja = numpy.array(self.j, dtype=numpy.double)
416 si = numpy.cumsum(ia)
417 sj = numpy.cumsum(ja)
418 ni = numpy.max(si) - si # ?
419 nj = numpy.max(sj) - sj
420 if self.subtype == "a":
421 w = numpy.minimum(ia, ja)
422 elif self.subtype == "b":
423 w = numpy.maximum(ia, ja)
424 elif self.subtype == "c":
425 w = ia
426 elif self.subtype == "d":
427 w = ia + ja
428 else:
429 _error("Unsupported subtype")
430
431 if self.smoothing:
432 # if self.pid==3: import ipdb; ipdb.set_trace()
433 w[1:] = numpy.mean(w[1:])
434
435 w[0] = -1.0
436
437 nr = len(w)
438 mx = numpy.zeros((nr, 4))
439 mx[:, 0] = self.pid
440 mx[:, 1] = ni
441 mx[:, 2] = nj
442 mx[:, 3] = w
443 return mx
444
445
446def rabinerJuangStepPattern(ptype, slope_weighting="d", smoothed=False):

Callers 9

rabinerJuangStepPatternFunction · 0.80
_RJtypeIFunction · 0.80
_RJtypeIIFunction · 0.80
_RJtypeIIIFunction · 0.80
_RJtypeIVFunction · 0.80
_RJtypeVFunction · 0.80
_RJtypeVIFunction · 0.80
_RJtypeVIIFunction · 0.80

Calls 1

_errorFunction · 0.70

Tested by

no test coverage detected