## 4 Detailed Design
### Social Tie Classifier System
#### 4.1.3 Example of Naive Bayes Classification  
To clarify our approach, we present an example. Let the database used as the training set for the Naive Bayes classifier resemble the data presented in Table 2, and consider that when the above-mentioned time \(T\) takes place, the collected history of meetings between a pair of nodes (\(X\),\(Y\)) is represented by the instance \(A\) = (NM = high, \(ACD\) = high, \(ATBC\) = low, \(MOU\) = yes, \(CA\) = no, \(FS^{2}\)). To answer if (\(X\), \(Y\)) are friends or not, FSF asks the Naive Bayes Algorithm, which will follow the steps below:  
**Step 1--**Determine the probability \(P(Class)\) of occurrence of each class (Equation (5)). \(P(Class)\) results from the division of the number of cases of class \(X\) by the total number of tuples in the database represented in the Table 2:  
\(P(Class=strong)=\frac{5}{15}=0.34\),  
\(P(Class=weak)=\frac{10}{15}=0.66\),  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**NM** & **ACD** & **ATBC** & **MOU** & **CA** & **FS** \\ \hline low & high & average & yes & no & weak \\ low & high & high & no & yes & weak \\ average & average & average & no & yes & weak \\ high & average & low & yes & yes & weak \\ high & low & low & no & no & strong \\ high & low & average & no & yes & strong \\ average & high & low & yes & no & weak \\ low & average & low & yes & no & weak \\ high & average & average & no & yes & strong \\ average & low & high & no & no & weak \\ average & high & high & no & yes & strong \\ high & high & average & yes & no & strong \\ average & average & low & no & no & weak \\ low & low & low & no & yes & weak \\ \hline \hline \end{tabular}
\end{table}
Table 2: A sample of the training data used in this work.  
**Step 2--**Determine the probability \(P(Class|a_{1},...,a_{n})\) of the attributes for the instance in question about every possible class (Equation (6)):  
\(P(Class=strong|NM=high)=\frac{3}{5}=0.6\),  
\(P(Class=weak|NM=high)=\frac{2}{10}=0.2\),  
\(P(Class=strong|ACD=high)=\frac{2}{5}=0.4\),  
\(P(Class=weak|ACD=high)=\frac{4}{10}=0.4\),  
\(P(Class=strong|ATBC=low)=\frac{5}{1}=0.2\),  
\(P(Class=weak|ATBC=low)=\frac{5}{10}=0.5\),  
\(P(Class=strong|MOU=no)=\frac{4}{5}=0.8\),  
\(P(Class=weak|MOU=no)=\frac{5}{10}=0.5\),  
\(P(Class=strong|CA=no)=\frac{2}{5}=0.4\),  
\(P(Class=weak|CA=no)=\frac{5}{10}=0.5\),  
**Step 3--**Determine the probability of each class based on the probability of the instance (Equation (7)):  
\(P(Class=strong|A)=(0.6\times 0.4\times 0.2\times 0.8\times 0.4\times 0.34)=0.0005\),  
\(P(Class=weak|A)=(0.2\times 0.4\times 0.5\times 0.5\times 0.5\times 0.66)=0.0066\).  
In this example, and according to the calculated probabilities, the friendship strength between nodes (_X,Y_) would be classified as _weak_. It is worth mentioning that, in this system, a pair of nodes can be classified either as an acquaintance or as a friend. Taking into account that this classification can have an impact on the FSF forwarding decisions, the system considers in such case that the pair of nodes are friends because it is the most important social tie. Finally, if a pair of nodes are not classified either as friends or acquaintances, they are considered unknown nodes.