# Outlier Detection and Prediction in Evolving Communities
## 4 COTILES for Outlier Detection
### Outlier Score  
To allow COTILES to detect community outliers, it is extended to compute an outlier score of each node. Nodes inherit their edges' labels, and can be considered as outliers or \"inliers\" based on their outlier score. The main idea for a node to be assigned with a high outlier score is based on the widely accepted definition of outliers in [19], which refers to them as nodes that deviate from neighboring observations. However, here we check their deviation in terms of both structure and content. In the algorithm we propose, each node is assigned an outlier score that is then updated, with every interaction (new edge) affecting the corresponding node. In order to take into account both the structure and content of the network, we propose a score consisting of two context-dependent weighted parts. Thus, the outlier score consists of two parts that can be equally or unequally weighted, assigning the same or different amount of importance to the nodes' structure and content. The structure part of the outlier score refers to whether the node is highly connected to one or more communities, while the content part refers to the popularity of the node's labels. Regarding structure, nodes that share few edges with community members while having many connections with nodes outside the community are more likely to leave the community during the evolution process, as their connectivity can easily decay. To this end, we define _Community Focus_ as a metric indicating the amount of connectivity that a node has with its most adjacent community. **Definition 3** (Community Focus): _We define \(\textit{CommunityFocus}\) as the number of intra-community edges between a node and the community it is most connected to in comparison to the total number of edges in the network._  
\[\textit{CommunityFocus}_{u}=\forall\textit{ C in G},\textit{max}\frac{\sum_{c\in 1} \left|(u,v)\right|\in G}{\sum_{c}\left|1\left|(u,v)\right|\in G}\]  
For each valid community in the network, the algorithm computes the node's community focus index irrespective of whether or not it is a member of a group. For example, when a node's edges are all adjacent to one community, the structure part equals 1. In contrast, when a node has its edges scattered between members of different communities or nodes not participating in any community, the structural part of its score tends to 0. Thus, community focus can be viewed as a node's degree of membership with respect to its adjacent communities. On the other hand, to quantify the content part of the outlier score we define the _Label Set Match_. **Definition 4** (Label Set Match). : _We define LabelSetMatch as the fraction of the intersection of the label sets of a node and its most connected community in comparison to the number of that community's distinct labels._  
\[LabelSetMatch_{u}=\forall\ C\ in\ G,max\frac{|LabelSet_{u}|^{\gamma}|LabelSet_{ C}|}{|LabelSet_{C}|}\]  
Label Set Match stands for the maximum match index between the label sets of the node and each community, and indicates the degree to which a node's content is significant for a community. For example, when most members of the community share the same labels with the node, the match index is higher, tending to 1; otherwise, it tends to 0, indicating low content similarity. Note that this index is similar to the Jaccard index of the two label sets, however, only the Community Label Set is kept in the denominator. In this way, central nodes with rich label sets are not penalized with higher outlier scores under the condition of having significant overlap with the corresponding communities' label sets. Our goal is to compose a metric of outlierness for each node using both its structure and content. As we have defined Community Focus and Label Set Match as metrics for structural and content outlierness, respectively, we now combine them to obtain a node's outlier score. **Definition 5** (Outlier Score).