MCPcopy Create free account
hub / github.com/DynamicTimeWarping/dtw-python / rabinerJuangStepPattern

Function rabinerJuangStepPattern

dtw/stepPattern.py:446–469  ·  view source on GitHub ↗

Construct a pattern classified according to the Rabiner-Juang scheme (Rabiner1993) See documentation for the StepPattern class.

(ptype, slope_weighting="d", smoothed=False)

Source from the content-addressed store, hash-verified

444
445
446def rabinerJuangStepPattern(ptype, slope_weighting="d", smoothed=False):
447 """Construct a pattern classified according to the Rabiner-Juang scheme (Rabiner1993)
448
449See documentation for the StepPattern class.
450"""
451
452 f = {
453 1: _RJtypeI,
454 2: _RJtypeII,
455 3: _RJtypeIII,
456 4: _RJtypeIV,
457 5: _RJtypeV,
458 6: _RJtypeVI,
459 7: _RJtypeVII
460 }.get(ptype, lambda: _error("Invalid type"))
461
462 r = f(slope_weighting, smoothed)
463 norm = "NA"
464 if slope_weighting == "c":
465 norm = "N"
466 elif slope_weighting == "d":
467 norm = "N+M"
468
469 return StepPattern(r, norm)
470
471
472def _RJtypeI(s, m):

Callers 4

test_plot_twowayMethod · 0.85
test_issue_5Method · 0.85

Calls 3

StepPatternClass · 0.85
getMethod · 0.80
_errorFunction · 0.70

Tested by 3

test_plot_twowayMethod · 0.68
test_issue_5Method · 0.68