Research Article

A Buffer Overflow Prediction Approach Based on Software Metrics and Machine Learning

Algorithm 1

BOVP based on Gini indexes.
input: D=,(X2,y2),…,, represents a feature property set,
represents the predicted attribute set.
output: CART model sets
(1) for in X
(2) for in
(3) search min(Gini);
(4) end for
(5) end for
(6) Build Trees TreeModel from Tj and xi;
(7) if H(D) ≤ && the current depth < &&// sample number of D
(8) Divide D to D1 and D2;
(9) DecisionTreeClassifier (D1, , , );
(10) DecisionTreeClassifier (D2, , , );
(11) else if
(12) drop D
(13) else
(14) D → leaf_Node; // convert to leaf node
(15) predictive class = the most number of classes; // average of samples
(16) break;
(17) end else
(18) return TreeModel
(19) Prediction on TMS.