add_genres_to_jams: Add genre to jams

Description Usage Arguments Value Examples

Description

This function loads the genres of the artist from the LFM-1b UGP dataset and merge them with the jams recieved from loadJams() function. Jam which do not have a genre after the merge will be treated as follows: A user usually has more than one jam associated with himself. Therefore all of his jams can be treated as a sequence. In this sequence the first jam with no genre will be detemined. All jams that come before this jam will be kept while all following jams will be deleted. Furthermore users with less than 2 jams will be deleted since they carry no useful information for the later training procedure of the Hidden Markov Model.

Usage

1
add_genres_to_jams(jams_clean, LFM_path, loadExample = FALSE)

Arguments

jams_clean

Return value of the loadJams() function.

LFM_path

Path to the location of the unzipped LFM folder downloaded from http://www.cp.jku.at/datasets/LFM-1b/LFM-1b_UGP.zip.

loadExample

If set to TRUE only example data will be loaded. This is mainly used to test the package.

Value

Returns a matrix containing the same columns as the return value of the load_jams() function except for one additional value:

genre

The genre the artist belongs to according to last.fm.

Examples

1
2
3
4
# 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)
print(jams_with_genre)

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