lenskit.metrics.RunAnalysisResult#

class lenskit.metrics.RunAnalysisResult(lmvs, gmvs, defaults)#

Bases: object

Results of a bulk metric computation.

Parameters:
  • lmvs (pd.DataFrame)

  • gmvs (pd.Series)

  • defaults (dict[str, float])

__init__(lmvs, gmvs, defaults)#
Parameters:

Methods

__init__(lmvs, gmvs, defaults)

global_metrics()

Get the global metric scores.

list_metrics([fill_missing])

Get the per-list scores of the results.

list_summary(*keys)

Sumamry statistics for the per-list metrics.

merge_from(other)

Merge another set of analysis results into this one.

global_metrics()#

Get the global metric scores. This is only the results of global metrics; it does not include aggregates of per-list metrics. For aggregates of per-list metrics, call list_summary().

Return type:

Series

list_metrics(fill_missing=True)#

Get the per-list scores of the results. This is a data frame with one row per list (with the list key on the inded), and one metric per column.

Parameters:

fill_missing – If True (the default), fills in missing values with each metric’s default value when available. Pass False if you want to do analyses that need to treat missing values differently.

Return type:

DataFrame

list_summary(*keys)#

Sumamry statistics for the per-list metrics. Each metric is on its own row, with columns reporting the following:

mean:

The mean metric value.

median:

The median metric value.

std:

The (sample) standard deviation of the metric.

Additional columns are added based on other options. Missing metric values are filled with their defaults before computing statistics.

Parameters:

keys (str) – Identifiers for different conditions that should be reported separately (grouping keys for the final result).

Return type:

DataFrame

merge_from(other)#

Merge another set of analysis results into this one.

Parameters:

other (RunAnalysisResult)