# Outlier Recognition via Linguistic Aggregation of Graph Databases
## 3 Detecting and Recognizing Outliers with Linguistic Information  
### Outliers in Terms of Linguistically Aggregated Information  
Now, we present the definitions of outliers based on fuzzy representations of linguistic information, i.e., by linguistically quantified statements with their degrees of truth. **Definition 1** (Outlier via the first form of linguistically quantified statement). : _Let \(\mathcal{D}=\{d_{1},\)\(\ldots,\)\(d_{N}\}\), \(N\in\mathbb{N}\), be a finite non-empty set of objects. Let \(S\) be a linguistic expression characterizing objects in \(\mathcal{D}\) and represented by a fuzzy set in \(\mathcal{D}\). Let \(Q\) be a relative regular non-increasing linguistic quantifier (e.g., \"almost none\", \"very few\", \"only several\", or synonymous) represented by a fuzzy set in \([0,1]\), and \(\alpha\in[0,1]\). An object \(d\in\mathcal{D}\) is outlier iff:_  
\[T(Q\;d\text{'s are }S)\geq\alpha. \tag{14}\]  
The degree of truth of (14) is evaluated via (8):  
\[T(Q\;d\text{'s are }S)=\mu_{Q}\left(\frac{\sum_{n=1}^{N}\mu_{S}(d_{n})}{N} \right). \tag{15}\]  
The definition of an outlier in terms of the second form of a linguistically quantified statement (7), i.e., taking into account two properties, \(S\) and \(W\) possessed by objects in \(\mathcal{D}\), is introduced:  
**Definition 2** (Outlier via the second form of linguistically quantified statement). : _Let \(\mathcal{D}\) is defined as in Definition 1, and \(S\), \(W\) are linguistic expressions characterizing objects \(d\in\mathcal{D}\) and represented by fuzzy sets in \(\mathcal{D}\). Let \(\alpha\in[0,1]\), and \(Q\)--a relative regular non-increasing linguistic quantifier as in Definition 1. An object \(d\in\mathcal{D}\) is outlier iff:_  
\[T(Q\;d\text{'s being }W\text{ are }S)\geq\alpha. \tag{16}\]  
The degree of truth of (16) can be evaluated with Equation (9) as:  
\[T\big{(}Q\;d\text{'s being }W\text{ are }S\big{)}=\mu_{Q}\bigg{(}\frac{\Sigma \text{count}(S\cap W)}{\Sigma\text{count}(W)}\bigg{)}. \tag{17}\]  
Two algorithms for detecting outliers are now presented, related to Definitions 1 and 2, respectively. They are designed as tools for detecting outliers in datasets (anomalies, exceptional data, etc.) in circumstances when only imprecise and linguistically formulated knowledge of their specificity is available. In particular, objects \(d\) in an analyzed dataset \(\mathcal{D}\) are considered to be outliers, if they are intuitively characterized by expressions such as \"small\", \"big\", \"hot\", \"very expensive\" etc., represented by the \(S\), \(W\) fuzzy sets, and the quantity of them is either not determined precisely, but linguistically expressed with statements as \"very few\", \"almost none\", represented by \(Q\). Hence, the algorithms confirm that outliers exists in a dataset, iff statements \"\(Q\;x\)'s are \(S^{\prime}\) or \"\(Q\;x\)'s being/having \(W\) are \(S^{\prime}\) are of sufficiently large (larger than threshold \(\alpha\)) degree of truth. The common assumptions for Algorithms 1 and 2 are:  
1. \(\mathcal{D}=\{d_{1},\)\(d_{2},\)\(\ldots,\)\(d_{N}\}\), \(N\in\mathbb{N}\)--a non-empty finite dataset,
2. \(S,W\)--linguistic labels for properties of \(d\)'s in \(\mathcal{D}\), represented by fuzzy sets,
3. \(\{Q_{1},Q_{2},\ldots,Q_{K}\}\), \(K\in\mathbb{N}\)--relative regular monotonically non-increasing linguistic quantifiers, as in Definition 1, given as fuzzy sets in \([0,1]\),
4. \(\alpha\in[0,1]\)--an arbitrarily chosen threshold for degrees of truth for (14), (16),
5. Two possible results are produced: _true_ = \"THERE EXIST OUTLIERS IN \(\mathcal{D}^{\prime}\), _false_ = \"NO OUTLIERS IN \(\mathcal{D}^{\prime}\). To detect outliers in \(\mathcal{D}\) using Algorithm 1, we need the entry query in the form of:  
\[\textit{How many d's are S?} \tag{18}\]  
to detect outliers in \(\mathcal{D}\) with respect to the \(S\) property and using linguistic quantifiers \(Q_{1},Q_{2},\ldots,Q_{K}\).