-
Notifications
You must be signed in to change notification settings - Fork 0
Statistics
This page gives an overview of the statistics implemented in app/helpers/statistics_helper.rb
. They can be used in the controllers with helper.FUNCTION_NAME
.
The item popularity (
- the total number the item was lent (
$n$ )- This reflects how popular the item was in the past.
- the average lending duration (
$\bar{t}$ )- Items can be lent for a very long time by the same person. This should also increase the popularity especially because it lowers the total number the item could be lent in the past.
- the amount of people on the waitlist (
$w$ )- While the first two components reflect the past, the length of the waitlist represents the current popularity.
- the age of the item (
$a$ )- The age normalizes the first two values.
The item popularity is computed by this formula:
All factors in the numerator are increased by
It can be used by calling helpers.statistics_item_popularity
.
Lists of items can be sorted by calling helpers.statistics_sort_items_by_popularity
. It takes an item list and returns the sorted item list. It takes an optional parameter order
to specify the sort order by passing either :asc
or :desc
.