<jupyter_start><jupyter_text>Importing the Necessary Libraries:<jupyter_code>import pandas as pd
import numpy as np
import sklearn
from sklearn.preprocessing import LabelEncoder as le<jupyter_output><empty_output><jupyter_text>Loading the Dataset:<jupyter_code>from sklearn import datasets
wine = datasets.load_wine()<jupyter_output><empty_output><jupyter_text>Exploring the Dataset:<jupyter_code>wine.feature_names
wine.target_names
"""Wine data features(top 5 records)"""
wine.data[0:5]
wine.target<jupyter_output><empty_output><jupyter_text>Splitting the Data:<jupyter_code>from sklearn.model_selection import train_test_split
X_train, X_test, Y_train, Y_test = train_test_split(wine.data, wine.target, test_size=0.3, random_state=109)<jupyter_output><empty_output><jupyter_text>Model Generation:<jupyter_code>from sklearn.naive_bayes import GaussianNB
gnb = GaussianNB()
gnb.fit(X_train, Y_train)
y_pred = gnb.predict(X_test)
y_pred<jupyter_output><empty_output><jupyter_text>Evaluating the Model:<jupyter_code>from sklearn.metrics import confusion_matrix, classification_report, accuracy_score
print(confusion_matrix(Y_test, y_pred))
print(classification_report(Y_test, y_pred))<jupyter_output>[[20  1  0]
 [ 2 15  2]
 [ 0  0 14]]
              precision    recall  f1-score   support

           0       0.91      0.95      0.93        21
           1       0.94      0.79      0.86        19
           2       0.88      1.00      0.93        14

    accuracy                           0.91        54
   macro avg       0.91      0.91      0.91        54
weighted avg       0.91      0.91      0.91        54<jupyter_text>Accuracy:<jupyter_code>print(accuracy_score(Y_test, y_pred))<jupyter_output>0.9074074074074074
{'fraction_non_alphanumeric': 0.08821822402785838, 'fraction_numerical': 0.05861868833430064, 'mean_word_length': 3.6847826086956523, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '440327', 'license': 'MIT', 'n_tokens_mistral': 675, 'n_tokens_neox': 613, 'n_words': 114, 'path': 'ml/Naive Bayes/Naive Bayes.ipynb', 'repo_name': 'icecreamcake101/AlgoBook', 'size': '1723'}