metrics

Normalized Discount Cumulative Gain (NDCG)

class cornac.metrics.NDCG(k=-1)[source]

Normalized Discount Cumulative Gain.

Parameters:
  • k (int, optional, default: -1 (all)) – The number of items in the top@k 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”.

References

https://en.wikipedia.org/wiki/Discounted_cumulative_gain

Normalized Cumulative Reciprocal Rank (NCRR)

class cornac.metrics.NCRR(k=-1)[source]

Normalized Cumulative Reciprocal Rank.

Parameters:
  • k (int, optional, default: -1 (all)) – The number of items in the top@k 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”.

References

https://en.wikipedia.org/wiki/Mean_reciprocal_rank

Precision

class cornac.metrics.Precision(k=-1)[source]

Precision@K.

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

Recall

class cornac.metrics.Recall(k=-1)[source]

Recall@K.

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

Fmeasure (F1)

class cornac.metrics.FMeasure(k=-1)[source]

F-measure@K@.

Parameters:
  • k (int, optional, default: -1 (all)) – The number of items in the top@k list.
  • name (string, value: 'F1@k') – 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.

Root Mean Squared Error (RMSE)

class cornac.metrics.RMSE[source]

Root Mean Squared Error.

Parameters:name (string, value: 'RMSE') – Name of the measure.