One of the most effective ways for estimating the impact and severity of line failures on the static security of the power system is contingency analysis. The contingency categorization approach uses the overall performance index to measure the system's severity (OPI). The newton raphson (NR) load flow technique is used to extract network variables in a contingency situation for each transmission line failure. Static security is categorised into five categories in this paper: secure (S), critically secure (CS), insecure (IS), highly insecure (HIS), and most insecure (MIS). The K closest neighbor machine learning strategy is presented to categorize these patterns. The proposed machine learning classifiers are trained on the IEEE 30 bus system before being evaluated on the IEEE 14, IEEE 57, and IEEE 118 bus systems. The suggested k-nearest neighbor (KNN) classifier increases the accuracy of power system security assessments categorization. A fuzzy logic approach was also investigated and implemented for the IEEE 14 bus test system to forecast the aforementioned five classifications.