# Adaptive Abnormal Oil Temperature Diagnosis Method of Transformer Based on Concept Drift
## 2 Materials and Methods
### Abnormal Detection of Oil Temperature Based on Bagging Ensemble Learning  
Based on background knowledge about the strong correlation between transformer working conditions and oil temperature, this paper proposes an abnormal detection approach of the transformer oil temperature based on bagging ensemble learning. According to bagging ensemble learning, the oil temperature prediction model is organized with a set of base classifiers and their power weights, which are trained in parallel by random sampling from historical working condition datasets and oil temperature datasets with replacements. The steps of Algorithm 1 are described as follows:  
```
Input: Training dataset \(\text{IS}=\{(\text{X}_{1},\text{Y}_{1}),(\text{X}_{2},\text{Y}_{2}),\ldots,( \text{X}_{n},\text{Y}_{n})\}\), which includes the historical working condition dataset of transformer X, historical oil temperature dataset Y, and initial base classifiers \(\text{C}=\{\text{C}_{1},\text{C}_{2},\ldots,\text{C}_{k}\}\). Output: Trained base classifiers C and their power weights \(\text{w}=\{\text{w}_{1},\text{w}_{2},\ldots,\text{w}_{k}\}\). The Steps of Algorithm 1: Step 1. Sample k training datasets \(\{\text{IS}_{1},\text{IS}_{2},\ldots,\text{IS}_{k}\}\) from IS independently from X with corresponding Y, where \(\text{X}_{i}\subseteq\text{X}\) and \(\text{Y}_{i}\subseteq\text{Y}\). Step 2. Train base classifier \(\text{C}_{i}\) from training set \(\text{IS}_{i}\). Therefore, k training datasets from IS\(\text{}\in\text{ IS}\) can independently construct k base classifiers \(\text{C}_{i}\in\text{C}\). Step 3. The expected value of predicted oil temperature \(\text{Y}^{\prime}\) can be calculated as \(\text{Y}\text{Y}^{\prime}=\sum_{i=1}^{k}\text{w}_{i}\text{Y}_{i}^{\prime}\) from k prediction results \(\text{Y}_{i}^{\prime}\) of \(\text{C}_{i}\), according to \(\text{C}_{i}\in\text{C}\), and \(\text{w}_{i}\in\text{w}\), where \(\text{w}_{i}=1/\text{k}\) and \(\sum_{i=1}^{k}\text{w}_{i}=1\). Step 4. Algorithm ends. ```  
**Algorithm 1** Oil Temperature Prediction Based on Bagging Ensemble Learning. According to trained base classifiers C and their power weights w from Algorithm 1, the present oil temperature can be predicted from the present working condition data. \begin{table}
\begin{tabular}{c c} \hline \hline
**Label** & **Description** \\ \hline Location & Specified districts that transformers located, China \\ \hline OCCUR_TIME & Timestamp ID of weather records at specified timepoint \\ \hline TEMPERATURE & Value of temperature at specified location \\ \hline HIGH_TEMPERATURE & Highest value of temperature in whole-day records at specified location \\ \hline LOW\_TEMPERATURETEM & Lowest value of temperature in whole day records at specified location \\ \hline RAIN & Value of rainfall capacity at specified date and specified location \\ \hline WIND_DIRECTION & Value of wind direction at specified hour and specified location \\ \hline WIND\_VELOCITY & Value of wind velocity at specified hour and specified location \\ \hline PRESSURE & Value of atmospheric pressure at specified hour and specified location \\ \hline HUMIDITY & Value of relative humidity at specified hour and specified location \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Description of weather data. Furthermore, through 2 preset thresholds \(\{\alpha,\beta\}\), \((0<\alpha<\beta<1)\), the deviation rates between the predicted oil temperature and actual oil temperature can be used to judge the present working state of the transformer using the 3-way decision-making rule. The flowchart of the 3-way decision-making rule is shown in Figure 1.  
The detailed steps of Algorithm 2 are described as follows:  
```
Input: Present working condition data TS, present actual oil temperature Y, k base classifiers \(\mathrm{C}=\{\mathrm{C}_{1},\mathrm{C}_{2},\ldots,\mathrm{C}_{k}\}\) and their power weights \(\mathrm{w}=\{\mathrm{w}_{1},\mathrm{w}_{2},\ldots,\mathrm{w}_{k}\}\), and 2 preset thresholds \(\alpha\) and \(\beta\).