# Predictive Analytics for Sucker Rod Pump Failures in Kazakhstan Oil Wells Using Machine Learning
## 5 Discussion  
While operating artificial lift wells, the uninterrupted operation of downhole pumping equipment, and as a result, wells, is affected by a large number of parameters of the production operation mode and equipment operation mode.  
The failure rate of sucker rod pumps is influenced by the following factors: the properties of the produced liquid (flow rate, water cut, viscosity), the operating mode of the pump, and the wellbore curvature.  
One of the most important factors influencing sucker rod pump failures is the properties of the produced liquid. Analysis and available studies show that a produced liquid with up to 45% water cut decreases the reliability of the SRP, and a water cut of more than 45% increases the reliability of the SRP. As the viscosity of the produced liquid increases, there is a tendency for the failure rate to decrease. Years of operation of the SRP show that with increasing pumping depth, the failure rate increases. The presence of mechanical impurities in the extracted liquid and its high corrosive activity also have a degree of influence on the number of SRP failures. Also, the type of SRP influences the dependence of the failure rate on the produced liquid water cut.  
The main discovery from our research is that training LightGBM classification models on data where class imbalance has been corrected did not yield an improved f1-score compared to models trained on uncorrected data. However, it did lead to a significant and consistent overestimation of the probability for the minority class. Furthermore, all the methods used for addressing class imbalance had detrimental effects on the calibration slope, with these effects becoming more pronounced as the event fraction decreased.  
The authors eliminated the imbalance to increase the historical data on the operation of wells in the artificial lift wells of the pilot field in less presented classes (data on well failures). In this case, the following approach was used to eliminate the imbalance--oversampling and undersampling datasets.  
We assessed the degree of influence of certain parameters on the failure rate of the SRP of the pilot field. Based on the available historical parameters of the pilot field well operation, and based on the principle of the influence of one or more parameters on downhole equipment failure, Figures 9 and 10 were obtained, which reflect the degree of influence of one or more parameters on the probability of failure of downhole pumping equipment.  
The methods of class imbalance method show the dependence of the probability of failure (whether the event will occur or not). The oversampling dataset method is, to a greater extent, based on the degree of wellbore curvature (f-201--wellbore curvature in Figure 9), the well operation mode (f-38--liquid flow rate), and the pump set depth (f-24--pump set depth), which is confirmed by the practical results of the well operation with the SRP. The undersampling dataset method is similar to the oversampling method, where wellbore curvature and well operation mode (f-201, f-38--wellbore curvature, liquid flow rate in Figure 10) have a greater impact on the probability of failure of downhole pumping equipment.  
Based on the results of the dependence of the pump failure probability on the main parameters influencing the failure, it can be concluded that the sampling method under class imbalance correctly derived the dependence of the failure probability on the influencing parameters. However, predicting the probability of failure using class imbalance sampling showed low results. We conclude that increasing the frequency of well operation data is necessary to improve failure prediction accuracy.