fintech-algorithms
Using a coding agent? Give it the skill: npx skills add IslamBaraka90/Fintech-Algorithms-Library What it does →

Shapelet Pattern Classifier

Install and import#

bash
npm install fintech-algorithms
ts
import { classify } from "fintech-algorithms/geometric-chart-patterns/pattern-matching/shapelet-pattern-classifier";

Signature#

classify()

Worked example#

executed This entry is a thin wrapper its test never calls directly, so it was invoked with the arguments its shared implementation received. Real output, not asserted against a published figure.

Input#

argument 1
[99.870299, 100.065403, 100.108942, 100.094882, 100.306776, 100.33253]

Showing 6 of 48 elements.

argument 2
[0, 1, 3, 6, 8, 6]

Showing 6 of 10 elements.

argument 3
0.6024320464983021

Call#

classify()

Returns#

object with 6 fields: distance, best_start, profile, threshold, matched, predicted_label

{
  "distance": 8.81773713357542e-15,
  "best_start": 20,
  "profile": [
    4.4429515304009595,
    4.021249553691412,
    3.1883762365539186,
    2.4542268418798887,
    2.742051350159151,
    2.8389981766588135
  ],
  "threshold": 0.6024320464983021,
  "matched": true,
  "predicted_label": true
}

Other exports#

This module also exports train, distance. Every module additionally exports run as an alias of its primary function, and a meta object carrying its catalog id, domain, family, shape and article URL.

Diagrams#

Shapelet Pattern Classifier — algorithm anatomy
Shapelet Pattern Classifier — article hero
Shapelet Pattern Classifier — calculation ledger
Shapelet Pattern Classifier — causal timeline
Shapelet Pattern Classifier — failure boundary
Shapelet Pattern Classifier — method comparison

How it works#

This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.

Read the article →

References#

The rest of the Pattern Matching family#