I am trying to implement a classification toolkit for univariate network data using igraph
and python
.
However, my question is actually more of an algorithms question in relational classification area instead of programming.
I am following Classification in Networked Data paper.
I am having a difficulty to understand what this paper refers to "Network-Only Bayes Classifier"(NBC) which is one of the relational classifiers explained in the paper.
I implemented Naive Bayes
classifier for text data using bag of words feature representation earlier. And the idea of Naive Bayes
on text data is clear on my mind.
I think this method (NBC) is a simple translation of the same idea to the relational classification area. However, I am confused with the notation used in the equations, so I couldn't figure out what is going on. I also have a question on the notation used in the paper here.
NBC is explained in page 14 on the paper,
Summary:
I need the pseudo-code of the "Network-Only Bayes Classifier"(NBC) explained in the paper, page 14.
Pseudo-code notation:
- Let's call
vs
the list of vertices in the graph.len(vs)
is the length.vs[i]
is the ith vertex. - Let's assume we have a univariate and binary scenario, i.e.,
vs[i].class
is either0
or1
and there is no other given feature of a node. - Let's assume we run a local classifier before so that every node has an initial label, which are calculated by the local classifier. I am only interested in with the relational classifier part.
- Let's call
v
the vertex we are trying to predict, andv.neighbors()
is the list of vertices which are neighbors ofv
. - Let's assume all the edge weights are
1
.
Now, I need the pseudo-code for:
def NBC(vs, v):
# v.class is 0 or 1
# v.neighbors is list of neighbor vertices
# vs is the list of all vertices
# This function returns 0 or 1
Edit:
To make your job easier, I did this example. I need the answer for last 2 equations.