1.simunlike仿真系统的建立( 运行效果 :输电线路故障诊断_哔哩哔哩_bilibili)
2.在仿真系统的基础上获取数据集
分别获取单相接地故障、两相接地故障、两相间短路故障、三相接地故障、三相间短路故障和正常状态下的电流(Ia,Ib,Ic)大小和电压(Ua,Ub和Uc)大小。
第一份数据集表格(只分正常和故障状态(故障状态包好所讲的五种故障状态)两种类型) 。第一列是标签:0代表正常,1代表故障,其余列是特征。一共是12001行数据,也就是12001个样本。
Output (S) | Ia | Ib | Ic | Va | Vb | Vc |
0 | -170.4721962 | 9.219613499 | 161.2525827 | 0.054490004 | -0.659920931 | 0.605430928 |
0 | -122.2357545 | 6.168667358 | 116.0670871 | 1.02E-01 | -0.628611547 | 0.526201589 |
0 | -90.16147364 | 3.813632243 | 86.3478414 | 0.141025528 | -0.605276859 | 0.464251331 |
0 | -79.90491555 | 2.398803491 | 77.50611206 | 0.156272457 | -0.602235331 | 0.445962874 |
0 | -63.88525488 | 0.590667394 | 63.29458748 | 0.180451483 | -0.591501424 | 0.411049941 |
0 | -55.95468067 | -1.001881742 | 56.95656241 | 0.193414077 | -0.590695397 | 0.39728132 |
0 | -45.24844608 | -2.586980211 | 47.83542629 | 0.212393207 | -0.584135795 | 0.371742588 |
0 | -47.84541956 | -3.428093604 | 51.27351316 | 0.216396222 | -0.59012288 | 0.373726657 |
0 | -43.29425856 | -4.511299677 | 47.80555823 | 0.229748367 | -0.587587955 | 0.357839588 |
0 | -43.47472218 | -5.38823325 | 48.86295543 | 0.235732767 | -0.591319681 | 0.355586914 |
1 | 417.147625 | 454.5558409 | 55.76611181 | 0.042344074 | -0.347171348 | 0.304827274 |
1 | 405.0813942 | 466.5163614 | 55.99691644 | 0.042349906 | -0.344838815 | 0.302488909 |
1 | 392.9152203 | 478.3617689 | 56.21390467 | 0.042345289 | -0.342421197 | 0.300075908 |
1 | 380.6521053 | 490.0891407 | 56.41702295 | 0.042330222 | -0.33991909 | 0.297588869 |
1 | 368.2950748 | 501.6955832 | 56.60622119 | 0.042304709 | -0.337333113 | 0.295028404 |
1 | 355.8471778 | 513.1782327 | 56.78145269 | 0.042268757 | -0.334663902 | 0.292395144 |
1 | 343.3114856 | 524.5342561 | 56.94267422 | 0.042222375 | -0.331912116 | 0.289689741 |
1 | 330.6910912 | 535.7608513 | 57.08984599 | 0.042165574 | -0.329078435 | 0.286912861 |
1 | 317.9891085 | 546.8552485 | 57.22293171 | 0.042098368 | -0.326163557 | 0.284065189 |
1 | 305.2086716 | 557.8147103 | 57.34189852 | 0.042020774 | -0.323168202 | 0.281147428 |
1 | 292.3529337 | 568.6365325 | 57.44671708 | 0.04193281 | -0.320093109 | 0.278160298 |
1 | 279.4250669 | 579.318045 | 57.53736153 | 0.041834499 | -0.316939036 | 0.275104537 |
1 | 266.4282609 | 589.8566124 | 57.61380949 | 0.041725865 | -0.313706762 | 0.271980897 |
2.第二份是将故障区分为具体的不同类型(一共五种),再算上正常的状态,因此是六分类。这里随意举出每种类别的两个样本进行展示。
G | C | B | A | Ia | Ib | Ic | Va | Vb | Vc |
1 | 0 | 0 | 1 | -151.2918124 | -9.677451563 | 85.80016226 | 0.400749853 | -0.132934945 | -0.267814907 |
1 | 0 | 0 | 1 | -336.1861826 | -76.28326195 | 18.32889658 | 0.312731934 | -0.123633156 | -0.189098779 |
1 | 0 | 1 | 1 | -343.4870147 | 104.5627513 | 3.794285309 | 0.272042501 | 0.011317575 | -0.283360076 |
1 | 0 | 1 | 1 | -339.1254001 | 105.4293167 | -0.267241225 | 0.27782054 | 0.021756839 | -0.299577378 |
0 | 1 | 1 | 0 | 19.38615173 | -785.553797 | 768.7279081 | -0.210406869 | -0.0020112 | 0.212418069 |
0 | 1 | 1 | 0 | 18.47841651 | -783.8619173 | 767.9410527 | -0.217651204 | -0.00260451 | 0.220255714 |
0 | 1 | 1 | 1 | 506.5917463 | 374.8825788 | -879.344997 | 0.042029705 | -0.025636401 | -0.016393305 |
0 | 1 | 1 | 1 | 495.1384715 | 387.4159615 | -880.4253096 | 0.042107683 | -0.025103056 | -0.017004627 |
1 | 1 | 1 | 1 | -89.03263152 | -732.8168572 | 821.9123732 | -0.036759479 | 0.005234219 | 0.03152526 |
1 | 1 | 1 | 1 | -75.8022885 | -740.3563342 | 816.2199695 | -0.03680063 | 0.004685917 | 0.032114713 |
0 | 0 | 0 | 0 | 10.54618626 | 79.38231464 | -93.21467968 | -0.537644345 | 0.548591338 | -0.010946993 |
0 | 0 | 0 | 0 | 9.590940965 | 80.11550744 | -92.99814299 | -0.542390522 | 0.543819429 | -0.001428907 |
3. 二分类代码结果展示
3.1建立随机森林前的原始数据特征可视化
每相的电压与电流散点图
数据类型的统计
3.2 将数据集分为训练集和测试集(4:1),建立模型
测试集结果(混淆矩阵)
测试集具体结果展示
3.3六分类故障诊断
建立模型前的数据可视化
六种类型在数据集的样本数
随机森林模型测试集结果 (识别准确率为87.79%)