About • Example • Documentation • Credits • License
This R package was made based in the article Generalização de Mineração de Sequências Restritas no Espaço e no Tempo, so its main goal is mining patterns present in spatio-temporal datasets. The R package was developed at CEFET/RJ for academic work.
In the next sections you can check an example of the running code, its documentation, development steps and so on. Please feel free to make contributions and contact in case of bugs/suggestions.
This example is also present in example folder, just clone it to run it.
library("gstsm")
<- as.data.frame(matrix(c("B", "B", "A", "C", "A",
D "C", "B", "C", "A", "B",
"C", "C", "A", "C", "A",
"B", "B", "D", "A", "B",
"B", "D", "D", "B", "D"
nrow = 5, ncol = 5, byrow=TRUE))
),
<- c("p1", "p2", "p3", "p4", "p5")
ponto <- c(1, 2, 3, 4, 5)
x <- c(0, 0, 0, 0, 0)
y <- y
z <- data.frame(ponto=ponto, x=x, y=y, z=z, stringsAsFactors = FALSE)
P
<- 0.8
gamma <- 2
beta <- 1
sigma
<- gstsm(D, P, gamma, beta, sigma)
gstsm_object
<- mine(gstsm_object) result
Here all the functions are described.
#' GSTSM
#'
#' S3 class definition for GSTSM.
#'
#' This algorithm is designed to the identification of frequent sequences in
#' STS datasets from the concept of Solid Ranged Groups (SRG).
#' GSTSM is based on the candidate-generating principle.
#' The goal is to start finding SRGs for sequences of size one.
#' Then it explores the support and the number of occurrences of SRGs for
#' larger sequences with a limited number of scans over the database.
#'
#' @param sts_dataset STS dataset
#' @param spatial_positions set of spatial positions
#' @param gamma minimum temporal frequency
#' @param beta minimum group size
#' @param sigma maximum distance between group points
#' @return a GSTSM object
#' @importFrom stats na.exclude
#' @export gstsm
<- function(sts_dataset, spatial_positions, gamma, beta, sigma) gstsm
#' S3 class definition for find method.
#'
#' @param object a GSTSM object
#' @param k size of sequence
#' @param ck set of candidates
#' @return Solid Ranged-Group(s) of all candidate sequences
#' @export find
<- function(object, ck) find
#' S3 class definition for merge method.
#'
#' @param object a GSTSM object
#' @param ck set of candidates
#' @return Solid Ranged-Group(s) of all candidate sequences
#' @export merge
<- function(object, ck) merge
#' S3 class definition for generate_candidates method.
#'
#' @param object a GSTSM object
#' @param srgk set of Solid Ranged Groups
#' @param k size of sequence
#' @return candidate sequences of size k + 1
#' @export generate_candidates
<- function(object, srgk) generate_candidates
#' S3 class definition for mine method.
#'
#' @param object a GSTSM object
#' @return all Solid Ranged Group(s) found, of all sizes
#' @export mine
<- function(object) mine
This package was made with the following open source projects:
MIT
Antonio Castro • @castroantonio
Cássio Souza • @cassiofb-dev
Jorge Rodrigues • @jorge-g99
Esther Pacitti •
Fabio Porto •
Florent Masseglia •
Rafaelli Coutinho • @rafaelliiicoutinho
Eduardo Ogasawara • @eogasawara