Pract 8 - Naive Bays Algorithm
Pract 8 - Naive Bays Algorithm
For example, if a fruit is red, round, and about 3 inches wide, we might call it
an apple. Even if these things are related, each one helps us decide it’s
An NB model is easy to build and particularly useful for very large data sets.
# Splitting the dataset into the Training set and Test set
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.20,
random_state = 0)
# Feature Scaling
from sklearn.preprocessing import StandardScaler
sc = StandardScaler()
X_train = sc.fit_transform(X_train)
X_test = sc.transform(X_test)