dmlc--dgl
a9e16c177c
* gnnfilm * update * readme Co-authored-by: zhjwy9343 <6593865@qq.com>
11 行
271 B
Python
11 行
271 B
Python
|
|
from sklearn.metrics import f1_score
|
|
import numpy as np
|
|
|
|
#function to compute f1 score
|
|
def evaluate_f1_score(pred, label):
|
|
pred = np.round(pred, 0).astype(np.int16)
|
|
pred = pred.flatten()
|
|
label = label.flatten()
|
|
return f1_score(y_pred=pred, y_true=label)
|