View Source LastfmArchive.Analytics.Commons (lastfm_archive v0.11.0)
Common data frame analytics functions.
Summary
Functions
Calculate stats for a single group such as "artist", "album".
Compute frequency for a columns subset, filter untitled albums.
Rank data frame by total plays count and return top n rows.
Types
@type data_frame() :: LastfmArchive.Behaviour.Analytics.data_frame()
@type group() :: LastfmArchive.Behaviour.Analytics.group()
Functions
@spec create_group_stats(data_frame(), String.t()) :: data_frame()
Calculate stats for a single group such as "artist", "album".
Stats include:
years_freq
: frequency of yearly occurrance per grouptotal_plays
: total number of plays per group
The function also pivots and creates additional year
columns
with annual play counts per group.
@spec frequencies(data_frame(), group()) :: data_frame()
Compute frequency for a columns subset, filter untitled albums.
@spec most_played(data_frame(), integer()) :: data_frame()
Rank data frame by total plays count and return top n rows.