Description Usage Arguments Value Examples
This function tests a Hidden Markov Model for Music Information retriaval by predicting the last genre of each sequence in the testdata set. Based on the result of this function the accuracy of a model can be calculated with the function calcAccuracy().
1 | test_model(trained_MIR_hmm, testdata)
|
trained_MIR_hmm |
An object of the class MIR_hmm as returned by MIR_hmm(). |
testdata |
Testdata as returned by the function split_data(). |
A matrix that contains the following two values for each row in the testdata:
ACTUAL |
The actual last value of the sequence. |
PREDICTED |
The predicted last value by the Hidden Markov Model. |
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Example for the case that all datasets are located in S:/
# Prepare data
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]]
# Train model
hmm <- MIR_hmm(training_dataset)
test_results <- test_model(hmm,test_dataset)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.