metrics

Normalized Discount Cumulative Gain (NDCG)

class cornac.metrics.NDCG(m=None)[source]

Normalized Discount Cumulative Gain.

Parameters:
  • m (int, optional, default: None) – The number of items in the top@m list, if None then all items are considered to compute NDCG.
  • name (string, value: 'NDCG') – Name of the measure.
  • type (string, value: 'ranking') – Type of the metric, e.g., “ranking”.

Normalized Cumulative Reciprocal Rank (NCRR)

class cornac.metrics.NCRR(m=None)[source]

Normalized Cumulative Reciprocal Rank.

Parameters:
  • m (int, optional, default: None) – The number of items in the top@m list, if None then all items are considered to compute NDCG.
  • name (string, value: 'NCRR') – Name of the measure.
  • type (string, value: 'ranking') – Type of the metric, e.g., “ranking”.

Mean Reciprocal Rank (MRR)

class cornac.metrics.MRR[source]

Mean Reciprocal Rank.

Parameters:
  • name (string, value: 'MRR') – Name of the measure.
  • type (string, value: 'ranking') – Type of the metric, e.g., “ranking”.

Precision

class cornac.metrics.Precision(m=20)[source]

Precision@M.

Parameters:
  • m (int, optional, default: 20) – The number of items in the top@m list.
  • name (string, value: 'Precision@m') – Name of the measure.
  • type (string, value: 'ranking') – Type of the metric, e.g., “ranking”.

Recall

class cornac.metrics.Recall(m=20)[source]

Recall@M.

Parameters:
  • m (int, optional, default: 20) – The number of items in the top@m list.
  • name (string, value: 'Recall@m') – Name of the measure.
  • type (string, value: 'ranking') – Type of the metric, e.g., “ranking”.

Fmeasure (F1)

class cornac.metrics.FMeasure(m=20)[source]

F-measure@M.

Parameters:
  • m (int, optional, default: 20) – The number of items in the top@m list.
  • name (string, value: 'F1@m') – Name of the measure.
  • type (string, value: 'ranking') – Type of the metric, e.g., “ranking”.

Mean Absolute Error (MAE)

class cornac.metrics.MAE[source]

Mean Absolute Error.

Parameters:
  • name (string, value: 'MAE') – Name of the measure.
  • type (string, value: 'prediction') – Type of the metric, e.g., “ranking”, “prediction”.

Root Mean Squared Error (RMSE)

class cornac.metrics.RMSE[source]

Root Mean Squared Error.

Parameters:
  • name (string, value: 'RMSE') – Name of the measure.
  • type (string, value: 'prediction') – Type of the metric, e.g., “ranking”, “prediction”.