Skip to content

Statistics

Christian R edited this page Jan 19, 2023 · 7 revisions

Introduction

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.

Item popularity

The item popularity is a measure for the popularity of an item (obviously). It consists of the following values:

  • 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:

$$ \frac{n\cdot\bar{t}\cdot w}{a} $$

It can be used by calling helpers.statistics_item_popularity.

ATTENTION: This feature is not merged into dev yet! See feature branch.

Clone this wiki locally