Implement Gaussian Naive Bayes classifier using scikit-learn on iris dataset.
Step 01: Import the library
Imported various modules like datasets, mertics, and GaussianNB from differnt libraries.
Step 02: Setup the Data
Here used datasets to load the inbuilt iris dataset and created objects X and y to store the data and the target value respectively.
Step 03: Model and its Score
• Take GaussianNB as a Machine Learning model to fit the data.
• Then predicted the output by passing X_test and also stored real target in expected_y.
- then printed classification report and confusion matrix for the classifier.
No comments:
Post a Comment