- Read Data:
Read the input data points from the CSV file.
- Preprocess Data:
Parse and preprocess the input data to create dictionaries for training and testing.
- Calculate Class Probabilities:
Calculate the total values for each class and prior class probabilities with Laplacian smoothing.
- Calculate Attribute Probabilities:
Calculate the probabilities for each attribute per class.
- Add Probabilities:
Add the logarithms of attribute probabilities to obtain combined probabilities.
- Multiply by Prior Class Probabilities:
Multiply the combined probabilities by prior class probabilities to obtain final probabilities.
- Predict Class Label:
Select the class label with the highest probability as the predicted class.