moved download button and recreated synth dataset to work with AnomalyDetection

This commit is contained in:
omri374 2019-09-11 15:30:39 +03:00
Родитель 1515e42f61
Коммит 7af519805a
4 изменённых файлов: 46791 добавлений и 9743 удалений

Просмотреть файл

@ -1,9 +1,9 @@
raw_content <- c("Error","Warn","Debug","Attach","Limit","No clue","Check with author")
rawdf <- data.frame(
date = rep(seq(as.POSIXct('2018-01-01 12:00:00'),as.POSIXct('2018-01-05 14:00:00'),by='20 min'),30),
category = sample(c('A','B','C'),replace = T,size = 8850),
content = sample(raw_content,replace = T,size = 8850)
date = rep(seq(as.POSIXct('2019-09-01 12:00:00'),as.POSIXct('2019-10-30 14:00:00'),by='1 hour'),30),
category = sample(c('A','B','C'),replace = T,prob = c(0.6,0.1,0.3),size = 42600),
content = sample(raw_content,replace = T,size = 42600)
)
library(dplyr)
@ -11,10 +11,11 @@ library(dplyr)
df_1h <- rawdf %>% mutate(date = as.POSIXct(date,format = '%d-%m-%Y %H')) %>%
group_by(date,category) %>% summarize(value = n())
catA <- df_1h[df_1h$category=='A',]
plot(catA$date,catA$value)
catB <- df_1h[df_1h$category=='B',]
plot(catB$date,catB$value,type = 'l')
write.csv(df_1h,"data/sample-1H.csv")
write.csv(rawdf,"data/sample-raw.csv")

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

5
ui.R
Просмотреть файл

@ -51,9 +51,7 @@ sidebar <- dashboardSidebar(
uiOutput("category"),
checkboxInput('interpolate',label = "Interpolate missing points",value = FALSE),
selectInput('breaks',"Select graph breaks",choices = c('1 sec','1 min','1 hour','1 day','1 week','1 month','1 year'),selected = '1 year'),
uiOutput('slider'),
downloadButton(outputId = "mydownload", label = "Download labels set")
uiOutput('slider')
)
)
@ -68,6 +66,7 @@ body <- dashboardBody(
actionButton("delete", "Remove selected points"),
h2('Currently marked points:'),
dataTableOutput("summaryTable"),
downloadButton(outputId = "mydownload", label = "Download labels set"),
h2('Inspect raw data:'),
h5('Select a point or more on the graph, then select a record on the \"Selected Points\" table to see raw data'),
dataTableOutput("rawtable")