Learn R Programming

otsad (version 0.2.0)

GetNumTrainingValues: Get Number of Training Values

Description

GetNumTrainingValues Calculates the number of values to be used as a training set.

Usage

GetNumTrainingValues(n.row, prob.percent = 0.15)

Arguments

n.row

Number of rows of the all dataset with training and test values.

prob.percent

Percentage of training values

Value

Number of training values.

Details

the number of values to be used as a training set is calculated as a minimum between 15% of the number of rows in the dataset and 15% of 5000.

References

A. Lavin and S. Ahmad, <U+201C>Evaluating Real-time Anomaly Detection Algorithms <U+2013> the Numenta Anomaly Benchmark,<U+201D> in 14th International Conference on Machine Learning and Applications (IEEE ICMLA<U+2019>15), 2015.

Examples

Run this code
# NOT RUN {
## Generate data
set.seed(100)
n <- 180
x <- sample(1:100, n, replace = TRUE)
x[70:90] <- sample(110:115, 21, replace = TRUE)
x[25] <- 200
x[150] <- 170
df <- data.frame(timestamp = 1:n, value = x)

# Get number of instances to train phase
GetNumTrainingValues(nrow(df))
# }

Run the code above in your browser using DataLab