Algorithm 1. The Proposed Model (XGBoost + MRMR) |
Model Inputs: |
N: Number of power outage instances |
F: Features (F1, F2, …, F26) |
Model Output: |
T: Power outage duration (t1, t2, …, tN) |
Begin: |
//Data Collection |
for i = 1 to N do |
record Data i //insert power outage data instances |
end |
//Data Preprocessing |
Analyze the Data //Feature Engineering |
//Feature Selection |
for each feature Fi in Data do //each feature Fi in Features |
score (Fi) = CalculateMRMR (Fi) //ascertain feature importance with MRMR |
end |
MS = max (score (Fi)) //select features with high MRMR ranking |
1 ≤ i ≤ m |
//Feature Encoding |
for each categorical data in MS do |
D = get_dummies |
//Feature Scaling |
for each numerical data in MS do |
S = get_standardscalers |
DS = joint(D,S) //obtained dataset after feature engineering |
//Dataset Split |
(DS1, DS2) = split (DS, ratio = 0.7) |
//split dataset into train DS1 (70%) and DS2 (30%) sets |
//Model Training |
Modelpop = XGB(DS1) |
//Model Evaluation |
for each di in DS2 do |
mi = Modelpop(di) //attain prediction of power outage duration |
MXGB = MXGB Ս mi |
end |
//Indexing Predicted Duration |
for each MXGB xi do |
if xi ≤ 60 then |
Return “VERY SHORT” |
elseif xi ≤ 120 then |
Return “SHORT” |
elseif xi ≤ 240 then |
Return “MEDIUM” |
else |
Return “LONG” |
end |
end |
End |