View Source Coda.Analytics (coda v0.1.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() :: Coda.Behaviour.Analytics.data_frame()
@type group() :: Coda.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(), keyword()) :: data_frame()
Compute frequency for a columns subset, filter untitled albums.
Options:
filter
- anExplorer.DataFrame
filter function that excludes data in analyticscounts
- includes only facets with this counts (integer)
@spec most_played(data_frame(), list()) :: data_frame()
Rank data frame by total plays count and return top n rows.