Sha256: 60f2389676347eb8f01af068012b21fb7ddabbf7084f160eeab9be7f41d33c0a

Contents?: true

Size: 528 Bytes

Versions: 4

Compression:

Stored size: 528 Bytes

Contents

tryCatch({
  library(AnomalyDetection)

  args <- commandArgs(trailingOnly = TRUE)

  con <- textConnection(args[2])
  data <- read.csv(con, stringsAsFactors = FALSE)
  data$timestamp <- as.POSIXct(data$timestamp)

  if (identical(args[1], "ts")) {
    res = AnomalyDetectionTs(data, direction = "both", alpha = 0.05)
  } else {
    res = AnomalyDetectionVec(data$count, direction = "both", alpha = 0.05, period = length(data$count) / 2 - 1)
  }

  write.csv(res$anoms)
}, error = function (e) {
  write.csv(geterrmessage())
})

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blazer-1.6.2 lib/blazer/detect_anomalies.R
blazer-1.6.1 lib/blazer/detect_anomalies.R
blazer-1.6.0 lib/blazer/detect_anomalies.R
blazer-1.5.1 lib/blazer/detect_anomalies.R