Package 'STMotif'

Title: Discovery of Motifs in Spatial-Time Series
Description: Allow to identify motifs in spatial-time series. A motif is a previously unknown subsequence of a (spatial) time series with relevant number of occurrences. For this purpose, the Combined Series Approach (CSA) is used.
Authors: Heraldo Borges [aut, cre] (CEFET/RJ), Amin Bazaz [aut] (Polytech'Montpellier), Eduardo Ogasawara [aut] (CEFET/RJ)
Maintainer: Heraldo Borges <[email protected]>
License: GPL-2 | GPL-3
Version: 2.0.0
Built: 2025-01-20 03:40:36 UTC
Source: https://github.com/heraldoborges/stmotif

Help Index


CSAMiningProcess

Description

CSA Datamining Process

Usage

CSAMiningProcess(D, DS, w, a, sb, tb, si, ka)

Arguments

D

Dataset containing numeric values

DS

Dataset containing SAX encoded values

w

Word Size

a

Number of letters to do the encode

sb

Spatial block size

tb

Temporal block size

si

Minimum number of occurrences inside each block

ka

Minimum number of spatial-time series with occurrences inside each block

Value

Return a list of ranked motifs. Each motif contains the information [isaxcode, recmatrix, vectst, rank], as described:

isaxcode: Motif sequences in character format

recmatrix: Matrix giving as information the blocks containing this motif

vectst: Coordinate of the start positions of the motif in the original dataset

rank: L of information used for motif ranking, as [dist, word, qtd, proj]

Examples

#CSA Datamining process
D  <- STMotif::example_dataset
DS <- NormSAX(STMotif::example_dataset,5)
rmotif <- CSAMiningProcess(D,DS,4,5,4,10,2,2)

Plot a heatmap of the dataset and highlight the selected motifs from the list

Description

Plot a heatmap of the dataset and highlight the selected motifs from the list

Usage

display_motifsDataset(dataset, rankList, alpha)

Arguments

dataset

Numerical dataset

rankList

List of ranked motifs

alpha

The cardinality of the SAX alphabet

Value

Heatmap dataset with seelected motifs

Examples

#Launch all the workflow
#Plot the result
D  <- STMotif::example_dataset
DS <- NormSAX(STMotif::example_dataset,5)
stmotifs <- SearchSTMotifs(D,DS,4,5,4,10,2,2)
rstmotifs <- RankSTMotifs(stmotifs)
display_motifsDataset(dataset = STMotif::example_dataset, rstmotifs[c(1:4)],  5)

Plot the selected spatial-time series with the selected motifs highlighted

Description

Plot the selected spatial-time series with the selected motifs highlighted

Usage

display_motifsSTSeries(dataset, rmotifs, space = c(1:length(dataset)))

Arguments

dataset

Dataset containing numeric values

rmotifs

List of ranked motifs

space

Select a range of columns to plot the corresponding spatial series

Value

Selected spatial series with the selected motifs highlighted

Examples

#Launch all the workflow
#Plot the result
D  <- STMotif::example_dataset
DS <- NormSAX(STMotif::example_dataset,5)
stmotifs <- SearchSTMotifs(D,DS,4,5,4,10,2,2)
rstmotifs <- RankSTMotifs(stmotifs)
display_motifsSTSeries(dataset = STMotif::example_dataset,rstmotifs[c(1:4)],space = c(1:4,10:12))

Example of dataset

Description

Toy example to launch functions.

Usage

example_dataset

Format

The dimensions of the dataset are 20 rows and 12 columns and this dataset contains 12 spatial-time series.


Normalize the data and SAX indexing

Description

Normalize the data and SAX indexing

Usage

NormSAX(D, a)

Arguments

D

Dataset containing numeric values

a

Number of letters use to encode

Value

A normalized and encoded dataset for a given alphabet a

Examples

#Normalization and Sax Dataset
DS <- NormSAX(STMotif::example_dataset, 5)

Rank the STmotifs Rank motifs by their quality

Description

Rank the STmotifs Rank motifs by their quality

Usage

RankSTMotifs(stmotifs)

Arguments

stmotifs

List of identified motifs

Value

The ranked version of the identified list of motifs

Examples

#Search for Spatial-time Motifs
D  <- STMotif::example_dataset
DS <- NormSAX(STMotif::example_dataset,5)
stmotifs <- SearchSTMotifs(D,DS,4,5,4,10,2,2)
rstmotifs <- RankSTMotifs(stmotifs)

SearchSTMotifs

Description

Search for Spatial-time Motifs

Usage

SearchSTMotifs(D, DS, w, a, sb, tb, si = 3, ka = 3)

Arguments

D

Dataset containing numeric values

DS

Dataset containing SAX encoded values

w

Word Size

a

Number of letters to do the encode

sb

"Space slice" Number of columns in each block

tb

"Time slice" Number of rows in each block

si

Support of Global Occurrence (GO)

ka

Support for Spatial Occurrence (SO)

Value

Return a list of identified motifs. Each motif contains the information [isaxcode, recmatrix, vectst], as described:

isaxcode: Motif sequences in character format

recmatrix: Matrix giving as information the blocks containing this motif

vectst: Coordinate of the start positions of the motif in the original dataset

Examples

#Search for Spatial-time Motifs
D  <- STMotif::example_dataset
DS <- NormSAX(STMotif::example_dataset,5)
stmotifs <- SearchSTMotifs(D,DS,4,5,4,10,2,2)

Package STMotif

Description

This package 'STSMotifs' allows to identify motifs in spatial-time series. A motif is a previously unknown subsequence of a (spatial) time series with relevant number of occurrences. For this purpose, the Combined Series Approach (CSA) is used.

Details

To have more information about the package : PACKAGE STMOTIF


Adjust a Dataset Adjust the dimensions of a dataset to build the blocks

Description

Adjust a Dataset Adjust the dimensions of a dataset to build the blocks

Usage

STSADatasetAdjust(D, tb, sb)

Arguments

D

Dataset containing numeric values

tb

Temporal block size

sb

Spatial block size

Value

Dataset adjusted to build the blocks.

Examples

#Adjust a block
D <- STSADatasetAdjust(STMotif::example_dataset, 20, 12)