################################################################################ ################################################################################# ### HW 1.2, Exercise No. 2 ### Work with the MOV data ## Add a new user feature for his/her average rating ## Does this feature follow a normal distrubution? ## Visualize the distribution using a Q-Q plot ## Do the Kolmogorov-Smirnov one sample test ### Barbora Hladka, Martin Holub ### ESSLLI 2015 ### http://ufal.mff.cuni.cz/esslli2015 ################################################################################# ################################################################################# ## get examples, votes, movies, users source("load-mov-data.R") ## get the average rating for each user u <- tapply(votes$rating, votes$user, mean) mu.u <- mean(u) sd.u <- sd(u) mu.u; sd.u # QQ plot qqnorm(u, main=("Average user rating Q-Q plot")) # Kolmogorov-Smirnov test ks.test(jitter(u), "pnorm", mu.u, sd.u) # histogram hist(u, breaks = 20, xlab = "average user rating", main = "Histogram for average user ratings") ## Draw a conclusion: average user rating does not follo a normal distribution