1) The document discusses using KNN and Naive Bayes algorithms to classify liver cancer cases based on patient attributes.
2) It compares KNN, a non-parametric algorithm that uses proximity to make classifications, to Naive Bayes, a supervised learning algorithm based on Bayes' theorem used for classification problems with high-dimensional training data.
3) Naive Bayes is faster than KNN and parametric, while KNN is non-parametric, but KNN has real-time execution capabilities.
3. Problem Statement:
Liver cancer is a type of cancer that starts in
the liver. Cancer starts when cells in the body
begin to grow out of control.About 41,260 new
cases will be diagnosed. About 30,520 people
will die of these cancers.
4. KNN VS Naive Bayes
The k-nearest neighbors algorithm,
also known as KNN or k-NN, is a non-
parametric, supervised learning
classifier, which uses proximity to
make classifications or predictions
about the grouping of an individual
data point.
KNN
Naïve Bayes algorithm is a
supervised learning algorithm,
which is based on Bayes theorem
and used for solving classification
problems. It is mainly used in text
classification that includes a high-
dimensional training dataset.
N
a
ive BA
y
e
s
5. which is better ?
KNN vs naive bayes :
Naive bayes is much faster than KNN due to
KNN's real-time execution. Naive bayes is
parametric whereas KNN is non-parametric.
7. import sklearn.metrics as metrics
import matplotlib.pyplot as plt
from sklearn.naive_bayes import
GaussianNB
import seaborn as sns
LIBRARIES:
import numpy as np
import pandas as pd
from sklearn.model_selection import
train_test_split
from sklearn.neighbors import
KNeighborsClassifier
from sklearn.metrics import accuracy_score