comparison analysis/analyse_gtzan.Rmd @ 0:205974c9568c tip

Initial commit. Predictions not included for lack of space.
author franrodalg <f.rodriguezalgarra@qmul.ac.uk>
date Sat, 29 Jun 2019 18:45:50 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:205974c9568c
1 ---
2 title: "Analyse GTZAN"
3 output: html_notebook
4 ---
5
6 ```{r}
7 source('../db/access_db.R')
8 library(tidyverse)
9 ```
10
11
12
13
14 ```{r}
15 excerpts_classes <- get_excerpts_classes()
16
17 excerpts_artist <- get_excerpts_artists()
18
19 classes_artists <- excerpts_classes %>%
20 inner_join(excerpts_artist, by = c('ex_id')) %>%
21 inner_join(get_class_names(), by = c('class_id'))
22
23 ```
24
25 ## Number of artists per class
26
27 ```{r}
28 (table_class_artists <-
29 classes_artists %>%
30 group_by(class) %>%
31 summarise(Unique_Artists = n_distinct(artist_id)))
32 ```
33
34 ```{r fig.height=2.5, fig.width=6}
35 ggplot(table_class_artists, aes(class, Unique_Artists)) +
36 geom_bar(stat = 'identity') +
37 scale_x_discrete(name = 'GTZAN Class') +
38 scale_y_continuous(name = 'Unique Artists',
39 breaks = c(0, 25, 50, 75),
40 limits = c(0, 75)) +
41 theme_bw() +
42 theme(axis.title = element_text(size = 24),
43 axis.title.x = element_text(vjust = -4),
44 axis.text = element_text(size = 22),
45 axis.text.x = element_text(angle = 45, vjust = 0.5))
46
47
48 ```
49
50 ## Number of recordings per artist
51
52
53 ```{r}
54 (table_excerpts_artists <-
55 classes_artists %>%
56 group_by(class, artist_id) %>%
57 summarise(rec = n_distinct(ex_id)))
58 ```
59
60 ```{r fig.height=2.5, fig.width=6}
61 ggplot(table_excerpts_artists, aes(class, Unique_Artists)) +
62 geom_boxplot(aes(x = class, y = rec)) +
63 scale_x_discrete(name = 'GTZAN Class') +
64 scale_y_continuous(name = 'Excerpts per Artist',
65 limits=c(0,40)) +
66 theme_bw() +
67 theme(axis.title = element_text(size = 24),
68 axis.title.x = element_text(vjust = -4),
69 axis.text = element_text(size = 22),
70 axis.text.x = element_text(angle = 45, vjust = 0.5))
71
72 ```