matrixprofile

package module
Version: v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

README

Build Status Windows Build Status codecov Go Report Card GoDoc License

go-matrixprofile

Golang library for computing a matrix profiles and matrix profile indexes. Features also include time series discords, time series segmentation, and motif discovery after computing the matrix profile. Visit The UCR Matrix Profile Page for more details into matrix profiles.

Contents

Installation

$ go get github.com/matrix-profile-foundation/go-matrixprofile

Quick start

// example_mp.go
package main

import (
	"fmt"

	mp "github.com/matrix-profile-foundation/go-matrixprofile"
)

func main() {
	sig := []float64{0, 0.99, 1, 0, 0, 0.98, 1, 0, 0, 0.96, 1, 0}

	p, err := mp.New(sig, nil, 4)
	if err != nil {
		panic(err)
	}

	if err = p.Compute(nil); err != nil {
		panic(err)
	}

	fmt.Printf("Signal:         %.3f\n", sig)
	fmt.Printf("Matrix Profile: %.3f\n", p.MP)
	fmt.Printf("Profile Index:  %5d\n", p.Idx)
}
$ go run example_mp.go
Signal:         [0.000 0.990 1.000 0.000 0.000 0.980 1.000 0.000 0.000 0.960 1.000 0.000]
Matrix Profile: [0.014 0.014 0.029 0.029 0.014 0.014 0.029 0.029 0.029]
Profile Index:  [    4     5     6     7     0     1     2     3     4]

Case studies

Matrix Profile

Going through a completely synthetic scenario, we'll cover what features to look for in a matrix profile, and what the additional Discords, TopKMotifs, and Segment tell us. We'll first be generating a fake signal that is composed of sine waves, noise, and sawtooth waves. We then run STOMP on the signal to calculte the matrix profile and matrix profile indexes.

mpsin subsequence length: 32

  • signal: This shows our raw data. Theres several oddities and patterns that can be seen here.
  • matrix profile: generated by running STOMP on this signal which generates both the matrix profile and the matrix profile index. In the matrix profile we see several spikes which indicate that these may be time series discords or anomalies in the time series.
  • corrected arc curve: This shows the segmentation of the time series. The two lowest dips around index 420 and 760 indicate potential state changes in the time series. At 420 we see the sinusoidal wave move into a more pulsed pattern. At 760 we see the pulsed pattern move into a sawtooth pattern.
  • discords: The discords graph shows the top 3 potential discords of the defined subsequence length, m, based on the 3 highest peaks in the matrix profile. This is mostly composed of noise.
  • motifs: These represent the top 6 motifs found from the time series. The first being the initial sine wave pattern. The second is during the pulsed sequence on a fall of the pulse to the noise. The third is during the pulsed sequence on the rise from the noise to the pulse. The fourth and fifth are the sawtooth patterns.

The code to generate the graph can be found in this example.

Multi-Dimensional Matrix Profile

Based on [4] we can extend the matrix profile algorithm to multi-dimensional scenario.

mpkdim subsequence length: 25

  • signal 0-2: the 3 time series dimensions
  • matrix profile 0-2: the k-dimensional matrix profile representing choose k from d time series. matrix profile 1 minima represent motifs that span at that time across 2 time series of the 3 available. matrix profile 2 minima represents the motifs that span at that time across 3 time series.

The plots can be generated by running

$ make example
go test ./... -run=Example
ok  	github.com/matrix-profile-foundation/go-matrixprofile	0.256s
ok  	github.com/matrix-profile-foundation/go-matrixprofile/av	(cached) [no tests to run]
ok  	github.com/matrix-profile-foundation/go-matrixprofile/siggen	(cached) [no tests to run]
ok  	github.com/matrix-profile-foundation/go-matrixprofile/util	(cached) [no tests to run]

A png file will be saved in the top level directory of the repository as mp_sine.png and mp_kdim.png

Benchmarks

BenchmarkMStomp-4                     	      39	  29853485 ns/op	 7336245 B/op	  227071 allocs/op
BenchmarkZNormalize-4                 	 7112282	       185 ns/op	     256 B/op	       1 allocs/op
BenchmarkMovmeanstd-4                 	   89810	     13628 ns/op	   32768 B/op	       4 allocs/op
BenchmarkCrossCorrelate-4             	   15190	     75262 ns/op	   24584 B/op	       3 allocs/op
BenchmarkMass-4                       	   15421	     78660 ns/op	   24842 B/op	       4 allocs/op
BenchmarkDistanceProfile-4            	   15190	     79092 ns/op	   24842 B/op	       4 allocs/op
BenchmarkCalculateDistanceProfile-4   	  220363	      4625 ns/op	       0 B/op	       0 allocs/op
BenchmarkStmp/m32_pts1k-4             	      15	  77806814 ns/op	24209736 B/op	    3892 allocs/op
BenchmarkStmp/m128_pts1k-4            	      16	  70673766 ns/op	22496294 B/op	    3508 allocs/op
BenchmarkStamp/m32_p2_pts1k-4         	      25	  46207243 ns/op	24284148 B/op	    3909 allocs/op
BenchmarkStomp/m128_p1_pts__1024-4    	     152	   7740858 ns/op	  196805 B/op	      28 allocs/op
BenchmarkStomp/m128_p2_pts__4096-4    	      13	  81826774 ns/op	 1116937 B/op	      39 allocs/op
BenchmarkStomp/m128_p2_pts_16384-4    	       1	1342203283 ns/op	 4776832 B/op	      45 allocs/op
BenchmarkStomp/m128_p4_pts_16384-4    	       1	1269550826 ns/op	 7153728 B/op	      67 allocs/op
BenchmarkStomp/m1024_p2_pts_16384-4   	       1	1235325258 ns/op	 4776832 B/op	      45 allocs/op
BenchmarkMpx/m128_p1_pts__1024-4      	     564	   2310017 ns/op	   84591 B/op	      26 allocs/op
BenchmarkMpx/m128_p2_pts__4096-4      	      63	  19927988 ns/op	  400206 B/op	      32 allocs/op
BenchmarkMpx/m128_p2_pts_16384-4      	       4	 294076163 ns/op	 1708912 B/op	      33 allocs/op
BenchmarkMpx/m128_p4_pts_16384-4      	       4	 327366290 ns/op	 2237776 B/op	      45 allocs/op
BenchmarkMpx/m1024_p2_pts_16384-4     	       4	 330582811 ns/op	 1737584 B/op	      33 allocs/op
BenchmarkUpdate-4                     	      80	  13849082 ns/op	  795065 B/op	      18 allocs/op

Ran on a 2018 MacBookAir on Jan 6, 2020

    Processor: 1.6 GHz Intel Core i5
       Memory: 8GB 2133 MHz LPDDR3
           OS: macOS Mojave v10.14.6
 Logical CPUs: 4
Physical CPUs: 2
$ make bench

Contributing

  • Fork the repository
  • Create a new branch (feature_* or bug_*)for the new feature or bug fix
  • Run tests
  • Commit your changes
  • Push code and open a new pull request

Testing

Run all tests including benchmarks

$ make all

Just run benchmarks

$ make bench

Just run tests

$ make test

Other libraries

Contact

License

The Apache 2.0 License. See LICENSE for more details.

Copyright (c) 2020 Matrix Profile Foundation and contributors.

Citations

[1] Chin-Chia Michael Yeh, Yan Zhu, Liudmila Ulanova, Nurjahan Begum, Yifei Ding, Hoang Anh Dau, Diego Furtado Silva, Abdullah Mueen, Eamonn Keogh (2016). Matrix Profile I: All Pairs Similarity Joins for Time Series: A Unifying View that Includes Motifs, Discords and Shapelets. IEEE ICDM 2016.

[2] Yan Zhu, Zachary Zimmerman, Nader Shakibay Senobari, Chin-Chia Michael Yeh, Gareth Funning, Abdullah Mueen, Philip Berisk and Eamonn Keogh (2016). Matrix Profile II: Exploiting a Novel Algorithm and GPUs to break the one Hundred Million Barrier for Time Series Motifs and Joins. IEEE ICDM 2016.

[3] Hoang Anh Dau and Eamonn Keogh (2017). Matrix Profile V: A Generic Technique to Incorporate Domain Knowledge into Motif Discovery. KDD 2017.

[4] Chin-Chia Michael Yeh, Nickolas Kavantzas, Eamonn Keogh (2017).Matrix Profile VI: Meaningful Multidimensional Motif Discovery. ICDM 2017.

[5] Shaghayegh Gharghabi, Yifei Ding, Chin-Chia Michael Yeh, Kaveh Kamgar, Liudmila Ulanova, Eamonn Keogh (2017). Matrix Profile VIII: Domain Agnostic Online Semantic Segmentation at Superhuman Performance Levels. ICDM 2017.

Documentation

Overview

Package matrixprofile computes the matrix profile and matrix profile index of a time series

Example
sig := []float64{0, 0.99, 1, 0, 0, 0.98, 1, 0, 0, 0.96, 1, 0}

mp, err := New(sig, nil, 4)
if err != nil {
	panic(err)
}

if err = mp.Compute(nil); err != nil {
	panic(err)
}

fmt.Printf("Signal:         %.3f\n", sig)
fmt.Printf("Matrix Profile: %.3f\n", mp.MP)
fmt.Printf("Profile Index:  %5d\n", mp.Idx)
Output:

Signal:         [0.000 0.990 1.000 0.000 0.000 0.980 1.000 0.000 0.000 0.960 1.000 0.000]
Matrix Profile: [0.014 0.014 0.029 0.029 0.014 0.014 0.029 0.029 0.029]
Profile Index:  [    4     5     6     7     0     1     2     3     4]
Example (CaseStudy)
sin := siggen.Sin(1, 5, 0, 0, 100, 2)
sin2 := siggen.Sin(0.25, 10, 0, 0.75, 100, 0.25)
saw := siggen.Sawtooth(0.5, 7, 0, 0, 100, 1)
line := siggen.Line(0, 0, len(sin2)*4)
sig := siggen.Append(sin, sin2, sin, line, sin2, line, sin2, line, saw)

noise := siggen.Noise(0.1, len(sig))
sig = siggen.Add(sig, noise)

var m int
m = 32
mp, err := New(sig, nil, m)
if err != nil {
	panic(err)
}

ao := NewAnalyzeOpts()
ao.OutputFilename = "mp_sine.png"

if err = mp.Analyze(nil, ao); err != nil {
	panic(err)
}

fmt.Printf("Saved png file result to %s\n", ao.OutputFilename)
Output:

Saved png file result to mp_sine.png
Example (KDimensionalCaseStudy)
sin := siggen.Sin(1, 4, 0, 0, 100, 0.25)
saw := siggen.Sawtooth(1, 4, 0, 0, 100, 0.25)
square := siggen.Square(1, 4, 0, 0, 100, 0.25)
line := siggen.Line(0, 0, len(sin)*4)
line2 := siggen.Line(0, 0, len(sin)*3)
sig := make([][]float64, 3)
sig[0] = siggen.Append(line, line, line, saw, line2, saw, line2)
sig[1] = siggen.Append(line, sin, line2, sin, line2, sin, line2, sin, line2)
sig[2] = siggen.Append(line, square, line2, square, line2, square, line2, square, line2)

sig[0] = siggen.Add(sig[0], siggen.Noise(0.1, len(sig[0])))
sig[1] = siggen.Add(sig[1], siggen.Noise(0.1, len(sig[0])))
sig[2] = siggen.Add(sig[2], siggen.Noise(0.1, len(sig[0])))

m := 25
mp, err := NewKMP(sig, m)
if err != nil {
	panic(err)
}

if err = mp.Compute(); err != nil {
	panic(err)
}

if err = mp.Visualize("mp_kdim.png"); err != nil {
	panic(err)
}

fmt.Println("Saved png file result to mp_kdim.png")
Output:

Saved png file result to mp_kdim.png

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func MPDist added in v0.4.0

func MPDist(a, b []float64, w int, o *MPDistOpts) (float64, error)

MPDist computes the matrix profile distance measure between a and b with a subsequence window of m.

Types

type Algo

type Algo string
const (
	AlgoSTOMP Algo = "stomp"
	AlgoSTAMP Algo = "stamp"
	AlgoSTMP  Algo = "stmp"
	AlgoMPX   Algo = "mpx"
)

type AnalyzeOpts added in v0.4.1

type AnalyzeOpts struct {
	OutputFilename string // relative or absolute filepath for the visualization output
	// contains filtered or unexported fields
}

AnalyzeOpts contains all the parameters needed for basic features to discover from a matrix profile. This is currently limited to motif, discord, and segmentation discovery.

func NewAnalyzeOpts

func NewAnalyzeOpts() *AnalyzeOpts

NewAnalyzeOpts creates a default set of parameters to analyze the matrix profile.

type KMP added in v0.4.0

type KMP struct {
	T [][]float64 // a set of timeseries where the number of row represents the number of dimensions and each row is a separate time series

	W   int         // length of a subsequence
	MP  [][]float64 // matrix profile
	Idx [][]int     // matrix profile index
	// contains filtered or unexported fields
}

KMP is a struct that tracks the current k-dimensional matrix profile computation for a given slice of timeseries of length N and subsequence length of M. The profile and the profile index are stored here.

func NewKMP added in v0.4.0

func NewKMP(t [][]float64, w int) (*KMP, error)

NewKMP creates a matrix profile struct specifically to be used with the k dimensional matrix profile computation. The number of rows represents the number of dimensions, and each row holds a series of points of equal length as each other.

func (KMP) Analyze added in v0.4.0

func (k KMP) Analyze(mo *MPOpts, ao *AnalyzeOpts) error

Analyze has not been implemented yet

func (*KMP) Compute added in v0.4.0

func (k *KMP) Compute() error

Compute runs a k dimensional matrix profile calculation across all time series

func (KMP) DiscoverDiscords added in v0.4.0

func (k KMP) DiscoverDiscords(kDiscords int, exclusionZone int) ([]int, error)

DiscoverDiscords has not been implemented yet

func (KMP) DiscoverMotifs added in v0.4.0

func (k KMP) DiscoverMotifs(kMotifs int, r float64) ([]MotifGroup, error)

DiscoverMotifs has not been implemented yet

func (KMP) DiscoverSegments added in v0.4.0

func (k KMP) DiscoverSegments() (int, float64, []float64)

DiscoverSegments has not been implemented yet

func (*KMP) Load added in v0.4.0

func (k *KMP) Load(filepath, format string) error

Load will attempt to load a matrix profile from a file for iterative use

func (KMP) Save added in v0.4.0

func (k KMP) Save(filepath, format string) error

Save will save the current matrix profile struct to disk

func (KMP) Visualize added in v0.4.0

func (k KMP) Visualize(fn string) error

Visualize creates a png of the k-dimensional matrix profile.

type MPDistOpts added in v0.4.1

type MPDistOpts struct {
	AV   av.AV
	Opts *MPOpts
}

func NewMPDistOpts added in v0.4.1

func NewMPDistOpts() *MPDistOpts

type MPOpts added in v0.4.1

type MPOpts struct {
	Algorithm    Algo    `json:"algorithm"`  // choose which algorithm to compute the matrix profile
	SamplePct    float64 `json:"sample_pct"` // only applicable to algorithm STAMP
	NJobs        int     `json:"n_jobs"`
	Euclidean    bool    `json:"euclidean"`                  // defaults to using euclidean distance instead of pearson correlation for matrix profile
	RemapNegCorr bool    `json:"remap_negative_correlation"` // defaults to no remapping. This is used so that highly negatively correlated sequences will show a low distance as well.
}

MPOpts are parameters to vary the algorithm to compute the matrix profile.

func NewMPOpts added in v0.4.0

func NewMPOpts() *MPOpts

NewMPOpts returns a default MPOpts

type MatrixProfile

type MatrixProfile struct {
	A        []float64    `json:"a"`                 // query time series
	B        []float64    `json:"b"`                 // timeseries to perform full join with
	AMean    []float64    `json:"a_mean"`            // sliding mean of a with a window of m each
	AStd     []float64    `json:"a_std"`             // sliding standard deviation of a with a window of m each
	BMean    []float64    `json:"b_mean"`            // sliding mean of b with a window of m each
	BStd     []float64    `json:"b_std"`             // sliding standard deviation of b with a window of m each
	BF       []complex128 `json:"b_fft"`             // holds an existing calculation of the FFT of b timeseries
	N        int          `json:"n"`                 // length of the timeseries
	W        int          `json:"w"`                 // length of a subsequence
	SelfJoin bool         `json:"self_join"`         // indicates whether a self join is performed with an exclusion zone
	MP       []float64    `json:"mp"`                // matrix profile
	Idx      []int        `json:"pi"`                // matrix profile index
	MPB      []float64    `json:"mp_ba"`             // matrix profile for the BA join
	IdxB     []int        `json:"pi_ba"`             // matrix profile index for the BA join
	AV       av.AV        `json:"annotation_vector"` // type of annotation vector which defaults to all ones
	Opts     *MPOpts      `json:"options"`           // options used for the computation
	Motifs   []MotifGroup
	Discords []int
}

MatrixProfile is a struct that tracks the current matrix profile computation for a given timeseries of length N and subsequence length of W. The profile and the profile index are stored here.

func New

func New(a, b []float64, w int) (*MatrixProfile, error)

New creates a matrix profile struct with a given timeseries length n and subsequence length of m. The first slice, a, is used as the initial timeseries to join with the second, b. If b is nil, then the matrix profile assumes a self join on the first timeseries.

func (MatrixProfile) Analyze

func (mp MatrixProfile) Analyze(mo *MPOpts, ao *AnalyzeOpts) error

Analyze performs the matrix profile computation and discovers various features from the profile such as motifs, discords, and segmentation. The results are visualized and saved into an output file.

func (MatrixProfile) ApplyAV added in v0.3.5

func (mp MatrixProfile) ApplyAV() ([]float64, []float64, error)

ApplyAV applies an annotation vector to the current matrix profile. Annotation vector values must be between 0 and 1.

func (*MatrixProfile) Compute

func (mp *MatrixProfile) Compute(o *MPOpts) error

Compute calculate the matrixprofile given a set of input options.

func (*MatrixProfile) DiscoverDiscords

func (mp *MatrixProfile) DiscoverDiscords(k int, exclusionZone int) ([]int, error)

DiscoverDiscords finds the top k time series discords starting indexes from a computed matrix profile. Each discovery of a discord will apply an exclusion zone around the found index so that new discords can be discovered.

func (*MatrixProfile) DiscoverMotifs

func (mp *MatrixProfile) DiscoverMotifs(k int, radius float64, neighborCount, exclusionZone int) ([]MotifGroup, error)

DiscoverMotifs will iteratively go through the matrix profile to find the top k motifs with a given radius. Only applies to self joins.

Example
// generate a signal mainly composed of sine waves and switches
// frequencies, amplitude, and offset midway through

// amplitude of 1, frequency of 5Hz, sampling frequency of 100 Hz,
// time of 2 seconds
sin := siggen.Sin(1, 5, 0, 0, 100, 2)

// amplitude of 0.25, frequency of 10Hz, offset of 0.75, sampling
// frequency of 100 Hz, time of 1 second
sin2 := siggen.Sin(0.25, 10, 0, 0.75, 100, 1)
sig := siggen.Append(sin, sin2)

// create a new MatrixProfile struct using the signal and a
// subsequence length of 32. The second subsequence is set to nil
// so we perform a self join.
mp, err := New(sig, nil, 32)
if err != nil {
	panic(err)
}

// run the STMP algorithm with self join. The matrix profile
// will be stored in mp.MP and the matrix profile index will
// be stored in mp.Idx
o := NewMPOpts()
o.Algorithm = AlgoSTMP

if err = mp.Compute(o); err != nil {
	panic(err)
}

// finds the top 3 motifs in the signal. Motif groups include
// all subsequences that are within 2 times the distance of the
// original motif pair
motifs, err := mp.DiscoverMotifs(2, 2, 10, mp.W/2)
if err != nil {
	panic(err)
}

for i, mg := range motifs {
	fmt.Printf("Motif Group %d\n", i)
	fmt.Printf("  %d motifs\n", len(mg.Idx))
}
Output:

Motif Group 0
  2 motifs
Motif Group 1
  2 motifs

func (MatrixProfile) DiscoverSegments

func (mp MatrixProfile) DiscoverSegments() (int, float64, []float64)

DiscoverSegments finds the the index where there may be a potential timeseries change. Returns the index of the potential change, value of the corrected arc curve score and the histogram of all the crossings for each index in the matrix profile index. This approach is based on the UCR paper on segmentation of timeseries using matrix profiles which can be found https://www.cs.ucr.edu/%7Eeamonn/Segmentation_ICDM.pdf

Example
// generate a signal mainly composed of sine waves and switches
// frequencies, amplitude, and offset midway through

// amplitude of 1, frequency of 5Hz, sampling frequency of 100 Hz,
// time of 2 seconds
sin := siggen.Sin(1, 5, 0, 0, 100, 2)

// amplitude of 0.25, frequency of 10Hz, offset of 0.75, sampling
// frequency of 100 Hz, time of 1 second
sin2 := siggen.Sin(0.25, 10, 0, 0.75, 100, 1)
sig := siggen.Append(sin, sin2)

// noise with an amplitude of 0.1
noise := siggen.Noise(0.01, len(sig))
sig = siggen.Add(sig, noise)

// create a new MatrixProfile struct using the signal and a
// subsequence length of 32. The second subsequence is set to nil
// so we perform a self join.
mp, err := New(sig, nil, 32)
if err != nil {
	panic(err)
}

// run the STMP algorithm with self join. The matrix profile
// will be stored in mp.MP and the matrix profile index will
// be stored in mp.Idx
o := NewMPOpts()
o.Algorithm = AlgoSTMP

if err = mp.Compute(o); err != nil {
	panic(err)
}

// segment the timeseries using the number of arc crossings over
// each index in the matrix profile index
idx, cac, _ := mp.DiscoverSegments()
fmt.Printf("Signal change foud at index: %d\n", idx)
fmt.Printf("Corrected Arc Curve (CAC) value: %.3f\n", cac)
Output:

Signal change foud at index: 194
Corrected Arc Curve (CAC) value: 0.000

func (*MatrixProfile) Load added in v0.3.6

func (mp *MatrixProfile) Load(filepath, format string) error

Load will attempt to load a matrix profile from a file for iterative use

func (MatrixProfile) Save added in v0.3.6

func (mp MatrixProfile) Save(filepath, format string) error

Save will save the current matrix profile struct to disk

func (*MatrixProfile) Update

func (mp *MatrixProfile) Update(newValues []float64) error

Update updates a matrix profile and matrix profile index in place providing streaming like behavior.

func (MatrixProfile) Visualize

func (mp MatrixProfile) Visualize(fn string) error

Visualize creates a png of the matrix profile given a matrix profile.

type MotifGroup

type MotifGroup struct {
	Idx     []int
	MinDist float64
}

MotifGroup stores a list of indices representing a similar motif along with the minimum distance that this set of motif composes of.

type PMP added in v0.4.0

type PMP struct {
	A        []float64   `json:"a"`         // query time series
	B        []float64   `json:"b"`         // timeseries to perform full join with
	SelfJoin bool        `json:"self_join"` // indicates whether a self join is performed with an exclusion zone
	PMP      [][]float64 `json:"pmp"`       // pan matrix profile
	PIdx     [][]int     `json:"ppi"`       // pan matrix profile index
	PWindows []int       `json:"windows"`   // pan matrix windows used and is aligned with PMP and PIdx
	Opts     *PMPOpts    `json:"options"`   // options used for the computation
}

PMP represents the pan matrix profile

func NewPMP added in v0.4.0

func NewPMP(a, b []float64) (*PMP, error)

NewPMP creates a new Pan matrix profile

func (PMP) Analyze added in v0.4.0

func (p PMP) Analyze(co *MPOpts, ao *AnalyzeOpts) error

Analyze has not been implemented yet

func (*PMP) Compute added in v0.4.0

func (p *PMP) Compute(o *PMPOpts) error

Compute calculate the pan matrixprofile given a set of input options.

func (PMP) DiscoverDiscords added in v0.4.0

func (p PMP) DiscoverDiscords(k int, exclusionZone int) ([]int, error)

DiscoverDiscords has not been implemented yet

func (PMP) DiscoverMotifs added in v0.4.0

func (p PMP) DiscoverMotifs(k int, r float64) ([]MotifGroup, error)

DiscoverMotifs has not been implemented yet

func (PMP) DiscoverSegments added in v0.4.0

func (p PMP) DiscoverSegments() (int, float64, []float64)

DiscoverSegments has not been implemented yet

func (*PMP) Load added in v0.4.0

func (p *PMP) Load(filepath, format string) error

Load will attempt to load a matrix profile from a file for iterative use

func (PMP) Save added in v0.4.0

func (p PMP) Save(filepath, format string) error

Save will save the current matrix profile struct to disk

func (PMP) Visualize added in v0.4.0

func (p PMP) Visualize(fn string, motifs []MotifGroup, discords []int, cac []float64) error

Visualize has not been implemented yet

type PMPOpts added in v0.4.1

type PMPOpts struct {
	LowerM int     `json:"lower_m"` // used for pan matrix profile
	UpperM int     `json:"upper_m"` // used for pan matrix profile
	MPOpts *MPOpts `json:"mp_options"`
}

PMPOpts are parameters to vary the algorithm to compute the pan matrix profile.

func NewPMPOpts added in v0.4.0

func NewPMPOpts(l, u int) *PMPOpts

NewPMPOpts returns a default PMPOpts

Directories

Path Synopsis
Package av generates a set of annotation vectors that can be applied onto a matrix profile before computing other features such as motifs, discords, etc.
Package av generates a set of annotation vectors that can be applied onto a matrix profile before computing other features such as motifs, discords, etc.
Package siggen provides basic timeseries generation wrappers
Package siggen provides basic timeseries generation wrappers
Package util is a set of utility functions that are used throughout the matrixprofile package.
Package util is a set of utility functions that are used throughout the matrixprofile package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL