Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Gvisual/src/gvisual/LinkPredictionAnalyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ public enum Method {
/** Sum of 1/log(degree) for each common neighbor. */
ADAMIC_ADAR,
/** Product of the two nodes' degrees. */
PREFERENTIAL_ATTACHMENT
PREFERENTIAL_ATTACHMENT,
/** Weighted average across multiple prediction methods. */
ENSEMBLE
}

// ── Result classes ──────────────────────────────────────────
Expand Down Expand Up @@ -275,7 +277,7 @@ public PredictionResult predictEnsemble(int topK) {

String[] verts = pairVertices.get(entry.getKey());
candidates.add(new PredictedLink(verts[0], verts[1], avg,
Method.COMMON_NEIGHBORS, pairCommon.get(entry.getKey())));
Method.ENSEMBLE, pairCommon.get(entry.getKey())));
}

Collections.sort(candidates, new Comparator<PredictedLink>() {
Expand All @@ -289,7 +291,7 @@ public int compare(PredictedLink a, PredictedLink b) {
0, Math.min(topK, candidates.size()));

return new PredictionResult(new ArrayList<PredictedLink>(top),
Method.COMMON_NEIGHBORS, n, existingEdges, possibleEdges, evaluated);
Method.ENSEMBLE, n, existingEdges, possibleEdges, evaluated);
}

// ── Scoring functions ───────────────────────────────────────
Expand Down
Loading