MCPcopy Create free account
hub / github.com/DeepGraphLearning/S3F / evaluate

Function evaluate

script/evaluate.py:28–44  ·  view source on GitHub ↗
(pred, target)

Source from the content-addressed store, hash-verified

26
27
28def evaluate(pred, target):
29 metric = {}
30 for _metric in METRICS:
31 if _metric == "mae":
32 score = F.l1_loss(pred, target, reduction="mean")
33 elif _metric == "rmse":
34 score = F.mse_loss(pred, target, reduction="mean").sqrt()
35 elif _metric == "spearmanr":
36 score = metrics.spearmanr(pred, target)
37 elif _metric == "pearsonr":
38 score = metrics.pearsonr(pred, target)
39 else:
40 raise ValueError("Unknown metric `%s`" % _metric)
41
42 metric[_metric] = score
43
44 return metric
45
46
47def graph_concat(graphs):

Callers 1

evaluate.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected