Skip to content

Instantly share code, notes, and snippets.

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.
@ethen8181
ethen8181 / plot.ipynb
Created October 26, 2017 02:48
plot.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ethen8181
ethen8181 / spmv.py
Last active June 29, 2022 20:04
Sparse-Matrix Vector Multiplication
# 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])