This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from lightfm import LightFM | |
from sklearn.metrics import roc_auc_score | |
from lightfm.datasets import fetch_movielens | |
def auc_score(model, ratings): | |
""" | |
computes area under the ROC curve (AUC). | |
The full name should probably be mean | |
auc score as it is computing the auc |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MxN matrix A and N sized vector b. Ab = | |
# [1, 0, 3] | |
# [0, 0, 0] | |
# [0, 2, 4] | |
# [1, 2, 3] | |
import numpy as np | |
cols = np.array([0, 2, 1, 2]) |
OlderNewer