split_data: Split data into training and test dataset

Description Usage Arguments Value Examples

Description

This function draws a random sample of a dataset as training dataset. The remaining non-drawn rows of the dataset will be the test dataset.

Usage

1
split_data(data, split_ratio = 0.5)

Arguments

data

a matrix of sequences in STS format as returend by the function create_time_sequence().

split_ratio

The split ratio that determines how many percent of the original dataset should be used as training dataset.

Value

A list containing the training dataset at list index 1 and the test dataset at list index 2.

Examples

1
2
3
4
5
6
7
# Example for the case that all datasets are located in S:/
jams <- load_jams("S:/", loadExample = TRUE)
jams_with_genre <- add_genres_to_jams(jams, "S:/", loadExample = TRUE)
jam_sequence <- create_time_sequence(jams_with_genre)
splitted_data <- split_data(jam_sequence)
training_dataset <- splitted_data[[1]]
test_dataset <- splitted_data[[2]]

simonhess/HMM documentation built on May 6, 2019, 11:44 a.m.