# A GIS-Based Hot and Cold Spots Detection Method by Extracting Emotions from Social Streams
## 3 The FESC Framework
As an example, we now consider the fuzzy partition in Figure 1. Suppose we set \(\mathrm{\hat{R}}\) = Medium high as the threshold value for the relevance. Let \(\mathrm{d_{h1}}\), \(\mathrm{d_{h2}}\),..., \(\mathrm{d_{hT}}\) be the T documents related to the hth subzone, where \(\mathrm{d_{ht}}\) is the document referring to the posts inserted in the tth time frame. This subzone will be labeled as a hot spot if all its documents are classified with the relevance of unpleasant emotions greater or equal to Medium high. Likewise, it will be labeled as a cold spot if all its documents are classified with the relevance of pleasant emotions greater or equal to Medium-High. The FESC algorithm, structured in pseudocode, is shown below. In the preprocessing phase, the partitioning of the study area in subzones is performed; the analyzed period is partitioned in T time frames, and the pleasant and unpleasant ER fuzzy partition is created. After classifying each document, the number of related documents classified with pleasant/unpleasant emotion relevance greater than or equal to the threshold value \(\mathrm{\hat{R}}\) is calculated for each subzone. If this number is equal to the number of time frames T, then the subzone is labeled as a cold or hot spot. Finally, the hot and cold spots thematic map is created. In Algorithm 1 the FESC method is schematized in pseudocode. ```
1. Partition the study area in n subzones;
2. Partition the analyzed period in T time frames having an equal time width;
3. Create the pleasant and unpleasant ER fuzzy partition;
4. Create the Dictionary of EC words;
5. Set the relevance threshold \(\tilde{\text{R}}\);
6. Extract the social messages;
7. Clean the irrelevant texts in the posts;
8. Create the Corpus of Documents aggregating the posts by subzone and time frames;
9. **For each** document:
10. Annotate terms belonging to pleasant and unpleasant emotional categories;
11. **For each** emotional category:
12. Compute the IF-TDF value by (4);
13. Calculate the emotional relevance by (5);
14. **Next:**
15. Aggregate the emotional relevance of pleasant emotional categories by (6);
16. Aggregate the emotional relevance of unpleasant emotional categories by (7);
17. Classify the document assigning the pleasant and unpleasant emotion relevances;
18. **Next:**
19. **For** each subzone:
20. \(\text{n}_{\text{cold}}\): = 0 // number of documents with pleasant emotion relevance \(\geq\tilde{\text{R}}\);
21. \(\text{n}_{\text{hot}}\): = 0 // number of documents with unpleasant emotion relevance \(\geq\tilde{\text{R}}\);
22. **For** each time frame:
23. \(\text{R}_{\text{p}}\): = pleasant emotion relevance of the corresponding document;
24. \(\text{R}_{\text{u}}\): = unpleasant emotion relevance of the corresponding document;
25. **If \(\text{R}_{\text{p}}\) = \(\geq\tilde{\text{R}}\) Then:**
26. \(\text{N}_{\text{cold}}\): = \(\text{n}_{\text{cold}}\) + 1;
27. **End if:**
28. **If \(\text{R}_{\text{u}}\) = \(\geq\tilde{\text{R}}\) Then:**
29. \(\text{n}_{\text{hot}}\): = \(\text{n}_{\text{hot}}\) + 1;
30. **End if:**
31. **Next:**
32. **If \(\text{n}_{\text{cold}}\) = T, Then:**
33. Label the subzone as a cold spot;
34. **Else:**
35. **If \(\text{n}_{\text{cold}}\) = T, Then:**
36. Label the subzone as a hot spot;
37. **End if:**
38. **End if:**
39. **Next:**
40. Create the hot and cold spots thematic map. ```  
**Algorithm 1**Fuzzy Emotion-based hot and cold Spots Classification (FESC).