Skip navigation.
Home

MovieLens movie's popularity plot/graph (Matlab)

This is the code to load the MovieLens dataset into Matlab and to do some plotting:

The simpleset way of loading the dataset is via ImportWizard

All I want to do is to plot a graph where x-axis is movie id and y-axis is popularity (number of ratings).

 

% column of movie_ids
m = ratings(:,3);

% 1:3592 = movie_ids
[freq,xout] = hist(m,(1:3592));

% plotting sorted by popularity
plot( sort(freq));

 

The result is a nice power law (long tailed) distribution.