Other Classification Models

K-Nearest Neighbors

How it Works?



from sklearn.neighbors import KNeighborsClassifier

classifier = KNeighborsClassifier(n_neighbors = 5, metric = 'minkowski', p = 2)
classifier.fit(X_train, y_train)

# Predicting the Test set results
y_pred = classifier.predict(X_test)

Naive Bayes Algorithm

Bayes Theorem

Algorithm

#1 Prior Probability

#2 Marginal Likehood

#3 Likehood

#4 Posterior Probability

from sklearn.naive_bayes import GaussianNB

classifier = GaussianNB()
classifier.fit(X_train,y_train)
y_pred = classifier.predict(X_test)

Logistic Regression

Accuracy: 89%

KNN

Accuracy: 93%

Naive Bayes

Accuracy: 90%

Made with Slides.com