# Univariate Outlier Detection: Precision-Driven Algorithm for Single-Cluster Scenarios
## 4 Results And Discussion
### Impact of Parameter Choices  
It is important to acknowledge that the chosen parameters for the modified hyperbolic tangent transformation (\(\alpha=6\), \(\beta=3\), \(\lambda=3\), \(\eta=3\)) might be data-dependent. These parameters influence the scaling, shifting, and stretching of the transformed data, impacting how effectively anomalies are distinguished from normal data points. **Justification for Parameter Choices:**  
All parameters, namely \(\alpha\), \(\beta\), \(\lambda\), and \(\eta\), are set to positive values. The parameter \(\alpha\) is set to 6, while \(\beta\), \(\lambda\), and \(\eta\) are all set to 3. The choice of 6 for scaling the input data (\(x\)) influences the horizontal stretching of the sigmoid curve (Figure 7). A higher \(\alpha\) value results in the curve being more sensitive to variations in the data, making it more likely to detect even subtle anomalies. However, it is crucial to find the right balance:  
* If \(\alpha\) is too small: Many outliers will be closer to the normal data points in the transformed space, potentially leading to missed detections. * If \(\alpha\) is too large: Many normal data points might be shifted into the range of outliers, resulting in false positives. Figure 6: Variation of F1 score, recall, accuracy, and precision against changing threshold values. Setting \(\alpha\) to 6 effectively allows the curve to decrease values closer to 0 and increase values closer to 1, enhancing the separation between normal data and outliers. The parameter \(\beta\) (set to 3 here) subtracts from the scaled input and shifts the center of the \(\tanh\) curve horizontally. This adjustment impacts where the transformation focuses its attention within the data range. Suppose \(x\) is an element in the range (0,1). The function \(\tanh\ \left(\alpha\cdot x-\beta\right)\times\lambda+\eta\), set with parameters \(\alpha=6\), \(\beta=3\), \(\lambda=3\), and \(\eta=3\), expands the range from (0,1) to (0,6), showcasing its transformative capability in data manipulation. In general, if \(\lambda=\eta\), \(\alpha-\beta\) is greater than 1, and \(-\beta<-1\), the image range is the open interval \((0,2\eta)\). Proof. : For \(x\) within the range \((0,1)\), the following applies:  
\[\alpha x-\beta\in[-\beta,\alpha-\beta]\ \Longrightarrow\ \tanh\ \left(\alpha x-\beta \right)\in[\tanh\ \left(-\beta\right),\tanh\ \left(\alpha-\beta\right)]\]  
Consequently, the range of \(F(x)\) is within the interval:  
\[[\tanh\ \left(-\beta\right)\cdot\lambda+\eta,\tanh\ \left(\alpha-\beta\right) \cdot\lambda+\eta]\]  
Thus, under the condition where \(\lambda=\eta\), \(\alpha-\beta\) is greater than 1, and \(-\beta<-1\), the range of \(F(x)\) simplifies to the open interval \((0,2\eta)\). Thus, the range of \(F(x)\) becomes  
\[(0,2\eta)=(0,6)\]  
**Transformation Steps:**  
1. \(\tanh\ (x)\): The initial graph has a sigmoid shape, ranging from \(-1\), rising gradually, reaching a maximum slope around 0, and then descending back to 1. 2. \(\tanh\ \left(x\cdot 6\right)\): Scaling the input by a factor of 6 horizontally stretches the sigmoid curve, resulting in a more elongated shape compared to the original \(\tanh\) function. 3. \(\tanh\ \left(x\cdot 6-3\right)\): Shifting the scaled input to the right by 3 units horizontally relocates the curve to the right. 4. \(\tanh\ \left(x\cdot 6-3\right)\cdot 3\): Multiplying the values vertically scales the graph, increasing the amplitude threefold. 5. \(\tanh\ \left(x\cdot 6-3\right)\cdot 3+3\): Adding 3 shifts the entire graph vertically upwards by three units. Figure 7: Impact of scaling parameter on sensitivity in sigmoid curve of \(\tanh\ \left(\alpha x-3\right)\cdot 3+3\). In summary, the parameter choices of 6 and 3 were obtained through experimentation and achieve a well-considered balance for this dataset. However, manually tuning these parameters might not be ideal for generalizability across different datasets.