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 |
CSA Datamining Process
CSAMiningProcess(D, DS, w, a, sb, tb, si, ka)
CSAMiningProcess(D, DS, w, a, sb, tb, si, ka)
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 |
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]
#CSA Datamining process D <- STMotif::example_dataset DS <- NormSAX(STMotif::example_dataset,5) rmotif <- CSAMiningProcess(D,DS,4,5,4,10,2,2)
#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
display_motifsDataset(dataset, rankList, alpha)
display_motifsDataset(dataset, rankList, alpha)
dataset |
Numerical dataset |
rankList |
List of ranked motifs |
alpha |
The cardinality of the SAX alphabet |
Heatmap dataset with seelected motifs
#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)
#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
display_motifsSTSeries(dataset, rmotifs, space = c(1:length(dataset)))
display_motifsSTSeries(dataset, rmotifs, space = c(1:length(dataset)))
dataset |
Dataset containing numeric values |
rmotifs |
List of ranked motifs |
space |
Select a range of columns to plot the corresponding spatial series |
Selected spatial series with the selected motifs highlighted
#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))
#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))
Toy example to launch functions.
example_dataset
example_dataset
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
NormSAX(D, a)
NormSAX(D, a)
D |
Dataset containing numeric values |
a |
Number of letters use to encode |
A normalized and encoded dataset for a given alphabet a
#Normalization and Sax Dataset DS <- NormSAX(STMotif::example_dataset, 5)
#Normalization and Sax Dataset DS <- NormSAX(STMotif::example_dataset, 5)
Rank the STmotifs Rank motifs by their quality
RankSTMotifs(stmotifs)
RankSTMotifs(stmotifs)
stmotifs |
List of identified motifs |
The ranked version of the identified list of motifs
#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)
#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)
Search for Spatial-time Motifs
SearchSTMotifs(D, DS, w, a, sb, tb, si = 3, ka = 3)
SearchSTMotifs(D, DS, w, a, sb, tb, si = 3, ka = 3)
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) |
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
#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)
#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)
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.
To have more information about the package : PACKAGE STMOTIF
Adjust a Dataset Adjust the dimensions of a dataset to build the blocks
STSADatasetAdjust(D, tb, sb)
STSADatasetAdjust(D, tb, sb)
D |
Dataset containing numeric values |
tb |
Temporal block size |
sb |
Spatial block size |
Dataset adjusted to build the blocks.
#Adjust a block D <- STSADatasetAdjust(STMotif::example_dataset, 20, 12)
#Adjust a block D <- STSADatasetAdjust(STMotif::example_dataset, 20, 12)