Skip to content

Commit

Permalink
Update all.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Junxiang Wang committed Mar 30, 2024
1 parent 06f8162 commit 6aaeb9f
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions all.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@
else:
dataset = graph
adj, train_dataset, test_dataset =split_dataset(dataset)
# lpsi = LPSI()
# alpha, thres, auc, f1, pred =lpsi.train(adj, train_dataset)
# print("LPSI:")
# print(f"train auc: {auc:.3f}, train f1: {f1:.3f}")
# metric=lpsi.test(adj, test_dataset, alpha, thres)
# print(f"test acc: {metric.acc:.3f}, test pr: {metric.pr:.3f}, test re: {metric.re:.3f}, test f1: {metric.f1:.3f}, test auc: {metric.auc:.3f}")
# netSleuth = NetSleuth()
# k, auc, f1=netSleuth.train(adj, train_dataset)
# print("NetSleuth:")
# print(f"train auc: {auc:.3f}, train f1: {f1:.3f}")
# metric = netSleuth.test(adj, test_dataset, k)
# print(f"test acc: {metric.acc:.3f}, test pr: {metric.pr:.3f}, test re: {metric.re:.3f}, test f1: {metric.f1:.3f}, test auc: {metric.auc:.3f}")
# ojc = OJC()
# Y, auc, f1 =ojc.train(adj, train_dataset)
# print("OJC:")
# print(f"train auc: {auc:.3f}, train f1: {f1:.3f}")
# metric=ojc.test(adj, test_dataset, Y)
# print(f"test acc: {metric.acc:.3f}, test pr: {metric.pr:.3f}, test re: {metric.re:.3f}, test f1: {metric.f1:.3f}, test auc: {metric.auc:.3f}")
# gcnsi = GCNSI()
# gcnsi_model, alpha, thres, auc, f1, pred =gcnsi.train(adj, train_dataset)
# print("GCNSI:")
# print(f"train auc: {auc:.3f}, train f1: {f1:.3f}")
# metric = gcnsi.test(adj, test_dataset, gcnsi_model, alpha, thres)
# print(f"test acc: {metric.acc:.3f}, test pr: {metric.pr:.3f}, test re: {metric.re:.3f}, test f1: {metric.f1:.3f}, test auc: {metric.auc:.3f}")
lpsi = LPSI()
alpha, thres, auc, f1, pred =lpsi.train(adj, train_dataset)
print("LPSI:")
print(f"train auc: {auc:.3f}, train f1: {f1:.3f}")
metric=lpsi.test(adj, test_dataset, alpha, thres)
print(f"test acc: {metric.acc:.3f}, test pr: {metric.pr:.3f}, test re: {metric.re:.3f}, test f1: {metric.f1:.3f}, test auc: {metric.auc:.3f}")
netSleuth = NetSleuth()
k, auc, f1=netSleuth.train(adj, train_dataset)
print("NetSleuth:")
print(f"train auc: {auc:.3f}, train f1: {f1:.3f}")
metric = netSleuth.test(adj, test_dataset, k)
print(f"test acc: {metric.acc:.3f}, test pr: {metric.pr:.3f}, test re: {metric.re:.3f}, test f1: {metric.f1:.3f}, test auc: {metric.auc:.3f}")
ojc = OJC()
Y, auc, f1 =ojc.train(adj, train_dataset)
print("OJC:")
print(f"train auc: {auc:.3f}, train f1: {f1:.3f}")
metric=ojc.test(adj, test_dataset, Y)
print(f"test acc: {metric.acc:.3f}, test pr: {metric.pr:.3f}, test re: {metric.re:.3f}, test f1: {metric.f1:.3f}, test auc: {metric.auc:.3f}")
gcnsi = GCNSI()
gcnsi_model, alpha, thres, auc, f1, pred =gcnsi.train(adj, train_dataset)
print("GCNSI:")
print(f"train auc: {auc:.3f}, train f1: {f1:.3f}")
metric = gcnsi.test(adj, test_dataset, gcnsi_model, alpha, thres)
print(f"test acc: {metric.acc:.3f}, test pr: {metric.pr:.3f}, test re: {metric.re:.3f}, test f1: {metric.f1:.3f}, test auc: {metric.auc:.3f}")
ivgd = IVGD()
diffusion_model = ivgd.train_diffusion(adj, train_dataset)
ivgd_model, thres, auc, f1, pred =ivgd.train(adj, train_dataset, diffusion_model)
Expand Down

0 comments on commit 6aaeb9f

Please sign in to comment.