# Toward a Standard Approach for Echo Chamber Detection: Reddit Case Study
## 3 Detecting Echo Chambers in Online Social Platforms
### Step 4: Homogeneous, Meso-Scale, Users' Clusters Identification  
Up to this step, we have described how to label a set of users with respect to their leaning on controversy and how to define their interaction network. In other words, we have identified the basic bricks to discuss both the _echo_ and the _chamber_ dimensions of a given phenomenon. However, conforming to the proposed Definition 1, we handle echo chambers as meso-scale topologies. Thus, we aim to detect subsets of nodes in the network that are homogeneous from an ideological and topological point of view. As stated in Section 2.3, we model such a problem relying on a specific instance of the CD problem, namely Labeled Community Detection. Among the LCD algorithms, we leverage Eva [49], a bottom-up low complexity algorithm designed to identify network meso-scale topologies by optimizing structural and attribute-homophilic clustering criteria. From a structural point of view, Eva leverages the modularity score (Definition 2) to incrementally update community membership. Such an update is then weighted in terms of cluster Purity (Definition 3), another function tailored to capture the ideological cohesion of a community. **Definition 2 (Modularity). **_Modularity is a quality score that measures the strength of the division of a network into modules. Formally:_  
\[Q=\frac{1}{(2m)}\sum_{uv}\biggl{[}M_{uv}-\frac{k_{u}k_{v}}{(2m)}\biggr{]} \delta(c_{u},c_{v}) \tag{1}\]_where \(m\) is the number of graph edges, \(M_{u,v}\) is the entry of the adjacency matrix for \(u,v\in V,k_{u},k_{v}\) the degree of \(u,v\) and \(\delta(c_{u},c_{v})\) identifies an indicator function taking value \(1\) iff \(u,v\) belong to the same community \(c\), 0 otherwise._  
**Definition 3** (Purity). : _Given a community \(c\in C\), its Purity is the product of the frequencies of the most frequent labels carried by its nodes. Formally:_  
\[P_{c}=\prod_{a\in A}\frac{max(\sum_{u\in c}a(u))}{|c|} \tag{2}\]  
_where \(A\) is the label set, \(a\in A\) is a label, \(a(u)\) is an indicator function that takes value \(1\) iff \(a\in A(u)\)._  
Once Eva has identified the candidate communities, we now discuss how to evaluate them to determine to what extent a community qualifies as an echo chamber. Since the analyzed phenomenon consists both of the _echo_ and the _chamber_ dimensions, we propose to evaluate them relying respectively on Purity and on Conductance (Definition 4). **Definition 4** (Conductance). : _Given a community \(c\in C\), its Conductance is the fraction of total edge volume that points outside the community._  
\[C_{c}=\frac{c_{s}}{2m_{s}+c_{s}} \tag{3}\]  
_where \(c_{s}\) is the number of community nodes and \(m_{s}\) is the number of community edges._  
Thus, we propose to set ideological and topological constraints on \(P_{c}\) and \(C_{c}\) by means of two thresholds i.e., \(P_{c}>p_{0}\) and \(C_{c}<c_{0}\) where \(p_{0}\) and \(c_{0}\) can be tuned according to the strictness of the definition of echo chamber. For instance, in the Reddit case study, we set the Purity score \(\leq\) 0.7 to make sure that most of the users in an echo chamber share the same ideological label. Meanwhile, for Conductance, we set a threshold equal to 0.5 to ensure that more than half of the total edges remain within the community boundaries. Further, we can also define the risk for a community to be an echo chamber through a function that takes into account both Purity and Conductance. The most straightforward function is the difference between the two terms. In Figure 1 we show the results obtained by subtracting Conductance from Purity and then normalizing values in a range from 0 to 1. Intuitively, we notice that such a risk is maximized when Purity is equal to 1 and Conductance equal to 0. Given the theoretical foundation set in this section, in the following we test our proposed framework on Reddit and discuss each of the pipeline steps. Figure 1: Risk for a community to be an echo chamber defined as the difference between Purity and Conductance.