predict_next: Predict next genre

Description Usage Arguments Value Examples

View source: R/hello.R

Description

This function predicts the next observation for a given listining history of genres. This is achieved by calculating probability of each genre to be the next genre. This is done with the forward algorithm. The genre with the highest probability is considered to be the next favorite genre of a user.

Usage

1

Arguments

MIR_hmm

An object of the class MIR_hmm as returned by MIR_hmm().

obs

A sequence of genres as list.

Value

Next probable genre.

Examples

1
2
3
4
5
6
7
# Load MIR HMM
hmm <- load_model("2_state_hmm")
# Create sequence of observations
seq <- c("rock","heavy metal", "pop")
# Predict next genre
prediction <- predict_next(hmm,seq)
print(prediction)

githerbert/HMM documentation built on May 30, 2019, 12:46 p.m.