lenskit.stats ============= .. py:module:: lenskit.stats .. autoapi-nested-parse:: LensKit statistical computations. Functions --------- .. autoapisummary:: lenskit.stats.gini Module Contents --------------- .. py:function:: gini(xs) Compute the Gini coefficient of an array of values. This is inspired by `Olivia Guest's implementation`_ and based on the `StatsDirect reference`_. It does *not* include Olivia's zero adjustment; the Gini coefficient is fine with some zeros, so long as the sum is strictly positive. .. _Olivia Guest's implementation: https://github.com/oliviaguest/gini .. _StatsDirect reference: https://www.statsdirect.com/help/default.htm#nonparametric_methods/gini.htm :Stability: Caller :param xs: An array of values representing the “resource” allocated to each instance. :returns: The Gini coefficient of the values in ``xs``. Exported Aliases ---------------- .. py:exception:: lenskit.stats.DataWarning Re-exported alias for :py:exc:`lenskit.diagnostics.DataWarning`.