Frecency¶
Description¶
Frecency is a Python library based on Mozilla’s algorithm that can be used to give arbitrary objects an absolute weight.
Functions¶
-
frecency.
score_item
(recencies, time_constant)¶ Calculates the absolute score of a given item.
Parameters: - recencies – an iterable containing int time offsets from the current time
- time_constant – numeric constant, should be > 0 in most cases
-
frecency.
score_items
(items, time_constant, score_function=None)¶ Calculates the absolute score for all items given.
Parameters: - items – a dictionary of {id: recencies}, or a list of pairs
- time_constant – numeric constant, should be >0 in most cases
- score_function – function matching the signature of score_item used to score individual items
References¶
[*] | Connor, Mike. “PlacesFrecency.” User:Mconnor/Past/PlacesFrecency - MozillaWiki. N.p., 19 Nov. 2010. Web. 10 July 2014. <https://wiki.mozilla.org/User:Mconnor/PlacesFrecency>. |
[†] | Mozilla Wiki Contributors, “Frecency algorithm.” Mozilla Developer Network. N.p., 27 May 2014. Web. 10 July 2014. <https://developer.mozilla.org/en-US/docs/Mozilla/Tech/Places/Frecency_algorithm>. |
[‡] | Ruderman, Jesse. “NewFrecency.” User:Jesse/NewFrecency - MozillaWiki. N.p., 22 May 2014. Web. 10 July 2014. <https://wiki.mozilla.org/User:Jesse/NewFrecency>. |
[§] | Spitzer, Seth. “GlobalFrecency.” User:Sspitzer/GlobalFrecency - MozillaWiki. N.p., 17 Jan. 2008. Web. 10 July 2014. <https://wiki.mozilla.org/User:Sspitzer/GlobalFrecency>. |