'How to executed code its taking to much time and also result not come

I have data shape (1315617, 23) and I was trying the below both model codes to run but this code was not executed in two days also, please let me know its need any changes in this code. No error in code but not coming result it's stuck.

# K-nearest neighbour
from sklearn.neighbors import KNeighborsClassifier
knn_clf = KNeighborsClassifier().fit(Xsm_train,ysm_train)
y_pred=knn_clf.predict(Xsm_test)

cm=confusion_matrix(ysm_test,y_pred)

cmd=ConfusionMatrixDisplay(cm,display_labels=['Death','Live'])

cmd.plot()

print(accuracy_score(ysm_test,y_pred))

print(classification_report(ysm_test,y_pred))


# SVM regression
from sklearn.svm import SVC
svm_clf = SVC(probability=True, kernel = 'linear').fit(Xsm_train,ysm_train)

y_pred=svm_clf.predict(Xsm_test)

cm=confusion_matrix(ysm_test,y_pred)
cmd=ConfusionMatrixDisplay(cm,display_labels=['Death','Live'])

cmd.plot()

print(accuracy_score(ysm_test,y_pred))

print(classification_report(ysm_test,y_pred))


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source