Description Usage Arguments Value Examples
This function initialise a Hidden Markov Model for music information retrieval. Thereby the model is basically a wrapper for two other HMM objects of different packages. The HMM package and the hmm.discnp package. hmm.discnp is used for fitting the model to the training dataset while hmm is used to predict next genres.
1 2 |
training_data |
training dataset as returned by the function split_data(). |
K |
The number of hidden states of the hidden markov model. See also hmm.discnp documentation for further information. |
verbose |
Determines if the single EM algorithm steps should be printed to console. |
tolerance |
The percentage change in log-likelihood that determines if the convergence citeria is met. |
itmax |
The maximum number of iterations of the EM Algorithm. |
An object of the class MIR_hmm that contains a list of the following hidden markov models:
discnp_hmm |
A Hidden Markov Model from the package hmm.discnp. |
hmm |
A Hidden Markov Model from the package HMM. |
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)
print(hmm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.