# Adaptive Abnormal Oil Temperature Diagnosis Method of Transformer Based on Concept Drift
## 2 Materials and Methods
### Concept Drift Solution of Oil Temperature Prediction and Abnormal Detection Model
The flowchart of concept drift adaptation is shown in Figure 2.  
First, use the concept drift detection algorithm (see Algorithm 3 for details) to detect whether the current concept drift occurs. The process is to calculates the relative error rate on the prediction data using the oil temperature prediction algorithm, and then obtain the detection result through Definition 2. If the result is that the concept drift did not happen, the algorithm ends. If the result requires a delayed decision, then update the prediction data and redetect the concept drift. If the result is that the concept drift happens, the oil temperature prediction model must be adjusted (see Algorithm 4 below for details). The following is a detailed description of Algorithm 3, the detection algorithm of concept drift. **Input**: The present transformer's working condition data series \(\mathrm{V_{x}}=\{\mathrm{X_{t_{1}}},\mathrm{X_{t_{2}}},\ldots,\mathrm{X_{t_{n}}}\}\), 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 the present actual oil temperature data series \(\mathrm{V_{y}}=\{\mathrm{Y_{t_{1}}},\mathrm{Y_{t_{2}}},\ldots,\mathrm{Y_{t_{n}}}\}\). **Output**: The prediction result matrix \(\mathrm{M}\) of all base classifiers and the decision of concept drift detection result L.  
**The Steps of Algorithm 3:**  
**Step 1. ** Initialize the delay decision threshold \(\lambda=0\) and the count number of delay decision \(\mathrm{a}=0\). **Step 2. ** Input the transformer's working condition data series \(\mathrm{V_{x}}\) into k base classifiers \(\mathrm{C}\), and, respectively,  
\[\mathrm{obtain\ the\ prediction\ results\:\mathrm{M}=\left[ \begin{array}{cccc}\mathrm{Y_{t_{1}} }^{\mathrm{C}_{1}}&\mathrm{Y_{t_{1}}^{\mathrm{C}_{1}}}&\ldots&\mathrm{Y_{t_{n} }^{\mathrm{C}_{1}}}\\ \mathrm{Y_{t_{1}}^{\mathrm{C}_{2}}}&\mathrm{Y_{t_{2}}^{\mathrm{C}_{2}}}& \ldots&\mathrm{Y_{t_{n}}^{\mathrm{C}_{2}}}\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ \mathrm{Y_{t_{1}}^{\mathrm{C}_{1}}}&\mathrm{Y_{t_{2}}^{\mathrm{C}_{1}}}&\ldots &\mathrm{Y_{t_{n}}^{\mathrm{C}_{k}}}\end{array} \right].\]  
Note: \(\mathrm{Y_{t_{1}}^{\mathrm{C}_{1}}}\in\mathrm{M}\), \(\mathrm{i}\in[1,\mathrm{n}]\) and \(\mathrm{j}\in[1,\mathrm{k}]\)  
**Step 3. ** Calculate the expected value of prediction \(\mathrm{TY^{\prime}}=\left\{\mathrm{TY^{\prime}_{t_{1}}},\,\mathrm{TY^{\prime} _{t_{2}}},\ldots,\mathrm{TY^{\prime}_{t_{n}}}\right\}\) based on \(\mathrm{M}\), where \(\mathrm{TY^{\prime}_{t_{1}}}=\sum_{k=1}^{k}\mathrm{w}\mathrm{Y^{C}_{k}}\), \(\mathrm{i}\in[1,\mathrm{n}]\) and \(\mathrm{j}\in[1,\mathrm{k}]\). **Step 4. ** According to **Definition 1**, calculate relative error rate \(\mathrm{\delta_{t_{1}}}=\left|\mathrm{TY^{\prime}_{t_{1}}}-\mathrm{Y_{t_{1}}} \right|/\mathrm{Y_{t_{1}}}\times 100\%\) and \(\mathrm{\delta}=\left\{\mathrm{\delta_{t_{1}}},\mathrm{\delta_{t_{2}}},\ldots, \mathrm{\delta_{t_{n}}}\right\}\). **Step 5. ** According to the 3-way decision-making rule in **Definition 2**, the decision L, whether to use the concept drift influence prediction model or not, will be made by the count number \(\mathrm{m}\) of relative error rate set \(\mathrm{\delta}\), which are less than the warming threshold \(\mathrm{\gamma}\). **Step 5.1. ** If the decision L = \"With Influence of Concept Drift\", then go to Step 6 and output the decision L and the prediction result matrix \(\mathrm{M}\). **Step 5.2. ** If the decision L = \"Without Influence of Concept Drift\", then go to Step 6 and output the decision L.  
**Step 5.3. ** If the decision L = \"Delay to Make Decision\", then update the count number of delay decision a to a \(\mathrm{a}=\mathrm{a}+1\) and compare a with the delayed decision threshold \(\lambda\) as following:  
**Step 5.3.1. ** If a \(\geq\lambda\), then return to Step 5.1. **Step 5.3.2.