# Defect Prediction for Capacitive Equipment in Power System
## 4 Experiments  
### Data Collection and Preprocessing  
During the operation of power systems, a significant amount of operational data and maintenance records are generated, forming a repository of historical data. These data comprise diverse information related to capacitive equipment, characterized by theirvaried attributes. This study utilized data obtained from the power grid department, encompassing a broad spectrum of information, including equipment name, power supply bureau, latitude and longitude of the equipment, voltage level, production date, running state, etc. After sorting through the data, the following variables were selected for modeling:  
* Equipment Name: Isolating switch, C phase current transformer, circuit breaker, etc. ;
* Power Supply Bureau: The power supply bureau to which the equipment belongs, such as Kunming Power Supply Bureau (501) and Qujing Power Supply Bureau (502);
* Equipment Type: Optical current transformer, oil-filled transformer, DC current transformer, etc. ;
* Full Name: The comprehensive name of the equipment along with its corresponding category, for instance,'substation equipment/primary equipment/combined electrical appliance/COMPASS/current transformer';
* Equipment Type Remarks: The designation of equipment types, such as main transformer bushing (B A GT10 GT11 KH00) and current transformer (B A GG00 GG20 GT70);
* Equipment Model: The specific model information of the equipment, such as LZZBJ-35W, SZ11-4000/35, etc. ;
* Manufacturer: The name of the equipment manufacturer;
* Topography: The geographic environment of the equipment's location, classified into six types: high mountain, hill, plain, river network, paddy field, and mountain, represented by numbers 1-6, respectively;
* Equipment longitude, latitude, and altitude;
* Pollution Level: The pollution level in the area where the equipment is situated, categorized into five levels;
* Substation: The substation to which the equipment belongs, e.g., 110 kV Lunan substation;
* Running State: Refers to the operational status of the substation, represented by the numbers 1-9, indicating operation, under construction, standby, etc. ;
* Voltage Level: Indicates the rated voltage of the equipment, represented by the numbers 1-18, corresponding to voltage levels of 10,000 V, 110,000 V, 220,000 V, etc. ;
* Voltage Type: Specifies whether the voltage is DC or AC, '1' indicates DC, '2' denotes AC, and '3' signifies that the voltage type is not distinguished. For example, 500,000 V voltage encompasses both AC and DC;
* Production Date and Commissioning Date: The date of the equipment leaving the factory and the date of the equipment being put into operation, respectively;
* Defect Occurrence Time: The timestamp when equipment defects occur;
* Years of Operation: For normal equipment, it represents the duration between the commissioning year and the current year. For faulty equipment, it signifies the duration between the commissioning year and the year the fault occurred;
* Defect Occurrence: A binary classification variable serving as the output for the defect occurrence prediction model, with two possible values: 'defect' and 'normal';
* Defect Level: A four-class variable used as the output for the defect level prediction model, comprising the following categories: 'urgent', 'critical', 'general', and 'others'. The collected sample variables underwent statistical analysis, revealing 11,715 samples with defects and 648,288 normal samples. The defective samples were categorized into four levels, as depicted in Table 1. The defect level was determined through manual inspections of faulty equipment, categorizing them based on the severity of defects. 'Urgent' denotes equipment with critical defects posing immediate threats to both equipment and personnel safety, requiring urgent attention, whereas 'others' signifies equipment with minor defects having minimal impact and causing no disruption to the normal operations. Table 2 presents some typical defect data.