# Visualization Assisted Approach to Anomaly and Attack Detection in Water Treatment Systems
## 5 Experiments and Discussion
### Machine Learning Based Detection
Therefore, the following features were selected: watLevel_R1_3_bool, watLevel_R1_2_bool, watLevel_R1_1_bool, Fullness_R1_perc, Crane_state_perc, Flow_state_perc, watLevel_R2_3_bool, watLevel_R2_2_bool, watLevel_R2_1_bool, Fullness_R2_perc, Pump_state_bool, PumpFlow_state_perc. During the experiments, the selection of the best hyper-parameters for each of the methods was performed using the GridSearchCV library function. As an input, one needs to set a list of parameters for a specific classifier. After that, according to given indicators, namely accuracy and f1-score, the best combination of parameters for a higher indicator is formed. Table 3 presents a list of parameters of the machine learning methods that were fed to the input of the GridSearchCV function. Figure 5: Architecture of the used experimental framework for the classification. \begin{table}
\begin{tabular}{c c} \hline \hline
**Name of Method** & **List of Parameters Values** \\ \hline AdaBoostClassifier & - algorithm: SAMME; SAMME.R learning\_rate: 1; 0.7; 0.5 \\ n\_estimators: 50; 100 \\ RandomForestClassifier & - criterion: entropy; gini max\_depth: None; 8; 13 min\_samples\_leaf: 1; \\ (RF) & 10; 50 n\_estimators: 50; 120; 240 \\ MultinomialNB & - alpha: 0; 1.0 \\ LogisticRegression (LR) & - max\_iter: 1000; 2000 solver: saga; liblinear; newton-cg \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Machine learning methods and list of their parameters. Tables 4 and 5 show appropriate parameters for each method with reference to the input data set. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Name of Method** & **Parameters** & **0\_1 csv** & **0\_2 csv** & **0\_3.csv** \\ \hline \multirow{3}{*}{AdaBoost Classifier} & algorithm & SAMME.R & SAMME.R & SAMME \\  & learning\_rate & 0.5 & 1 & 1 \\  & n\_estimators & 50 & 50 & 50 \\ \hline \multirow{3}{*}{RF} & criterion & entropy & entropy & entropy \\  & max\_depth & None & None & None \\  & min\_samples\_leaf & 1 & 1 & 1 \\  & n\_estimators & 50 & 50 & 50 \\ \hline \multirow{3}{*}{LR} & multinomialNB & alpha & 0 & 0 \\ \hline \multirow{3}{*}{SVM} & max\_iter & 1000 & 1000 & 1000 \\  & solver & liblinear & liblinear & liblinear \\ \hline \multirow{3}{*}{DecisionTree Classifier} & alpha & 0.00001 & 0.0001 & 0.0001 \\  & loss & hinge & hinge & squared\_hinge \\  & penalty & l2 & elasticnet & l2 \\ \hline \multirow{3}{*}{DecisionTree Classifier} & criterion & gini & gini & gini \\  & min\_samples\_leaf & 1 & 1 & 1 \\  & splitter & best & random & best \\ \hline \multirow{3}{*}{Ridge Classifier} & alpha & 1.0 & 1.0 & 1.0 \\  & solver & sag & auto & auto \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Appropriate parameters of machine learning methods depending on the input dataset. \begin{table}
\begin{tabular}{c c} \hline \hline
**Name of Method** & **List of Parameters Values** \\ \hline \multirow{3}{*}{SVM} & - alpha: 0.0001; 0.00001 loss: hinge; squared\_hinge penalty: elasticnet; l2 \\  & - criterion: gini; entropy min\_samples\_leaf: 1; 10; 20; 50 splitter: best; random \\ RidgeClassifier & - alpha: 1.0; 2.0 solver: auto; svd; lsqr; sag \\ \hline \hline \end{tabular}
\end{table} 
Table 3: _Cont._