in src/main/java/com/twitter/sbf/core/MHAlgorithm.java [1218:1232]
private static double evalLikelihoodWeighted(Graph graph, SparseBinaryMatrix matrix, int vertexId,
int[] factor, double weightCoeff) {
double truePosWeight = 0;
int numTruePositive = 0;
if (factor.length > 0) {
for (int neighborId : graph.getNeighbors(vertexId)) {
if (Util.hasCommonElement(factor, matrix.getRow(neighborId))) {
numTruePositive++;
truePosWeight += graph.getWeightOfEdge(vertexId, neighborId);
}
}
}
return likelihoodInternal(graph, vertexId, numTruePositive, truePosWeight,
matrix.nnzInColumnSum(factor), weightCoeff);
}