Mercurial > hg > confint
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/analysis/analyse_gtzan.Rmd Sat Jun 29 18:45:50 2019 +0100 @@ -0,0 +1,72 @@ +--- +title: "Analyse GTZAN" +output: html_notebook +--- + +```{r} +source('../db/access_db.R') +library(tidyverse) +``` + + + + +```{r} +excerpts_classes <- get_excerpts_classes() + +excerpts_artist <- get_excerpts_artists() + +classes_artists <- excerpts_classes %>% + inner_join(excerpts_artist, by = c('ex_id')) %>% + inner_join(get_class_names(), by = c('class_id')) + +``` + +## Number of artists per class + +```{r} +(table_class_artists <- + classes_artists %>% + group_by(class) %>% + summarise(Unique_Artists = n_distinct(artist_id))) +``` + +```{r fig.height=2.5, fig.width=6} +ggplot(table_class_artists, aes(class, Unique_Artists)) + + geom_bar(stat = 'identity') + + scale_x_discrete(name = 'GTZAN Class') + + scale_y_continuous(name = 'Unique Artists', + breaks = c(0, 25, 50, 75), + limits = c(0, 75)) + + theme_bw() + + theme(axis.title = element_text(size = 24), + axis.title.x = element_text(vjust = -4), + axis.text = element_text(size = 22), + axis.text.x = element_text(angle = 45, vjust = 0.5)) + + +``` + +## Number of recordings per artist + + +```{r} +(table_excerpts_artists <- + classes_artists %>% + group_by(class, artist_id) %>% + summarise(rec = n_distinct(ex_id))) +``` + +```{r fig.height=2.5, fig.width=6} +ggplot(table_excerpts_artists, aes(class, Unique_Artists)) + + geom_boxplot(aes(x = class, y = rec)) + + scale_x_discrete(name = 'GTZAN Class') + + scale_y_continuous(name = 'Excerpts per Artist', + limits=c(0,40)) + + theme_bw() + + theme(axis.title = element_text(size = 24), + axis.title.x = element_text(vjust = -4), + axis.text = element_text(size = 22), + axis.text.x = element_text(angle = 45, vjust = 0.5)) + +```