Skip to content

Instantly share code, notes, and snippets.

@AI-MOO
Created May 6, 2022 10:15
Show Gist options
  • Save AI-MOO/8deba777df85fb439ddec115b4abe926 to your computer and use it in GitHub Desktop.
Save AI-MOO/8deba777df85fb439ddec115b4abe926 to your computer and use it in GitHub Desktop.
# تدريب النموذج على بيانات التدريب
KN_clf = KNeighborsClassifier().fit(X_train, y_train)
# اختبار النموذج عن طريق توقع بيانات الاختبار
KN_prediction = KN_clf.predict(X_test)
# التحقق من ضبط النموذج عن طريق مقارنة القيم الحقيقية و القيم المتوقعة
KN_accuracy = accuracy_score(y_test, KN_prediction)*100
# Accuracy | الضبط
print('K Nearest Neighbors Classifier accuracy: {}%'.format(KN_accuracy))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment