Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed description #21

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Package: EventDetectR
Version: 0.3.4
Version: 0.3.6
Title: Event Detection Framework
Description: Detect events in time-series data. Combines multiple well-known R packages like 'forecast' and 'neuralnet' to deliver an easily configurable tool for multivariate event detection.
Authors@R:
c(
person("Margarita", "Rebolledo", email="[email protected]", role=c("aut")),
person("Sowmya", "Chandrasekaran", email="[email protected]", role=c("aut")),
person("Frederik", "Rehbach", email="[email protected]", role=c("aut", "cre")),
person("Sowmya", "Chandrasekaran", email="[email protected]", role=c("aut", "cre")),
person("Frederik", "Rehbach", email="[email protected]", role=c("aut")),
person("Steffen", "Moritz", email="[email protected]", role=c("aut"), comment = c(ORCID = "0000-0002-0085-1804"))
)
Maintainer: Sowmya Chandrasekaran<[email protected]>
Encoding: UTF-8
LazyData: yes
Type: Package
ByteCompile: TRUE
Expand All @@ -18,7 +18,8 @@ URL: https://github.com/frehbach/EventDetectR
Repository: CRAN
Depends:
R (>= 3.1.0)
Imports: imputeTS, forecast, ggplot2, gridExtra, neuralnet
Imports: imputeTS, forecast, ggplot2, gridExtra, neuralnet, Rdpack
RdMacros: Rdpack
Suggests: testthat, utils, caret, e1071
License: GPL-3
RoxygenNote: 6.1.1
RoxygenNote: 7.1.1
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ import(imputeTS)
import(neuralnet)
import(stats)
import(utils)
importFrom(Rdpack,reprompt)
8 changes: 5 additions & 3 deletions R/EventDetectR-package.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#' @title EventDetectR-package description
#' @description
#' The EventDetectR package is a modular event detection system
#' Detect events/ anomalies in time-series data.

#'
#' @details The EventDetectR package enables detection of events/ anomalies in multivariate time-series data. It combines multiple well-known R packages like 'forecast, 'neuralnet' to deliver an easily configurable tool for event detection.
#'
#' @name EventDetectR-package
#'
#'
#' @docType package
#' @import stats
#' @import utils
#' @importFrom Rdpack reprompt
#' @references
#' \insertRef{Chan20a}{EventDetectR}\cr
if(getRversion() >= "2.15.1") utils::globalVariables(c("x","y"))
NULL
2 changes: 1 addition & 1 deletion R/detectEvents.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ detectEvents <- function(x,
}else{
modelingData <- x[1:(index + windowSize),,drop=FALSE]
eventPositions <- which(edModel$eventHistory)
# Added by Sowmya to check if eventPositions exists
# Added to check if eventPositions exists
if(length(eventPositions>0))
{
modelingData <- modelingData[-eventPositions, , drop = FALSE]
Expand Down
2 changes: 1 addition & 1 deletion R/getDefaultControlLists.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ getDefaultPostControl <- function() {
defaultControlList <- list(
nStandardDeviationseventThreshold = 2,
eventThreshold = .7,
bedWindowSize = 30
bedWindowSize = 10
)
}
2 changes: 1 addition & 1 deletion R/model_NeuralNetwork.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#' Fitting Neuralnet Models
#' @details Multivariate Neuralnetwork model is formulated for each of the parameter using its own lagged values and rest of all parameters involved. For instance, considering 3 parameters 'p1', 'p2', 'p3', the value of 'p1' at time step 'i' is calclated as \cr
#' \code{p1[i] = p2[i] + p3[i] + p1[i-1]} \cr
#'
#' It is recommended to activate the normalization of the data.
#' @param x data
#' @param control control list with settings
#' @return fitted multivariate neural network model
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ require(devtools)
install_github("frehbach/EventDetectR")
```

Soon the package will also be available on CRAN.
The package is available on CRAN and can be installed:

install.packages('EventDetectR')

## Usage
The main function of the EventDetectR package is:
Expand Down Expand Up @@ -69,7 +71,7 @@ getDefaultModelControl()
getDefaultPostControl()
```

The event classification itself is shown in the graph below. #TODO make this graph look nice
The event classification itself is shown in the graph below.

![Alt text](doc/Ver2_windowimage.png?raw=true "detectEvents.R")

Expand Down Expand Up @@ -97,7 +99,7 @@ Since it was not specified on the function call the event duration defaults to 1
-------------

## Graphical User Interface
A graphical user interface (GUI) for the EventDetectR package is currently in development.
A graphical user interface (GUI) for the EventDetectR package is also available.
Check out the most recent status at: [EventDetectGUI](https://github.com/frehbach/EventDetectGUI)

-------------
Expand Down
8 changes: 5 additions & 3 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
year <- sub("-.*", "", meta$Date)
vers <- paste("R package version", meta$Version)
year <- 2019
vers <- paste("R package version", year)

citHeader("To cite the EventDetectR package, use:")

bibentry(bibtype = "Manual",
title = "EventDetectR",
author = personList(as.person("Steffen Moritz"), as.person("Frederik Rehbach")),
author = personList(as.person("Sowmya Chandrasekaran"),as.person("Steffen Moritz"), as.person("Margarita Rebolledo"),as.person("Frederik Rehbach")),
year = year,
note = vers,
organization = "Institute for Data Science, Engineering, and Analytics, Technische Hochschule Koeln",
address = "Steinmüllerallee 1, 51643 Gummersbach",
url = "https://CRAN.R-project.org/package=EventDetectR")
9 changes: 9 additions & 0 deletions inst/REFERENCES.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@techreport{Chan20a,
author = {Sowmya Chandrasekaran and Margarita Rebolledo and Thomas Bartz-Beielstein},
title = {EventDetectR – An Open-Source Event Detection System},
url = {https://nbn-resolving.org/urn:nbn:de:hbz:832-cos4-9232},
abstract = {EventDetectR: An efficient Event Detection System (EDS) capable of detecting unexpected water quality conditions. This approach uses multiple algorithms to model the relationship between various multivariate water quality signals. Then the residuals of the models were utilized in constructing the event detection algorithm, which provides a continuous measure of the probability of an event at every time step. The proposed framework was tested for water contamination events with industrial data from automated water quality sensors. The results showed that the framework is reliable with better performance and is highly suitable for event detection.},
language = {en},
institution={Institute for Data Science, Engineering, and Analytics, TH K\"oln, Steinmüllerallee 1, 51643 Gummersbach, Germany},
year={2020}
}
5 changes: 4 additions & 1 deletion man/EventDetectR-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions man/buildEDModel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 13 additions & 5 deletions man/detectEvents.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/model_NeuralNetwork.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/plot.edObject.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions man/simulateEvents.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified tests/testthat/Rplots.pdf
Binary file not shown.
9 changes: 0 additions & 9 deletions tests/testthat/test-eventClassification.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,6 @@ test_that("neural network prediction works",
expect_true(!any(p2$Event))


#Check that normalization is really deactivated if setting says so
x <- stationBData[100:200,-1]
m <- buildEDModel(x, dataPreparationControl = list(useNormalization = F),buildModelAlgo = "NeuralNetwork",ignoreVarianceWarning = TRUE)
excludedVariable <- length(m$excludedVariables)
newDataReal <- stationBData[201:220,-1]
p <- predict.NeuralNetwork(m,newDataReal)
expect_equal(nrow(p$predictions),nrow(newDataReal))
expect_equal(ncol(p$predictions),(ncol(stationBData)-1-excludedVariable))

})