Multinomial_Naive_Bias_classifier

The Multinomial Naive Bayes classifier was utilized to predict the values in the "pred" column of a dataset containing two categorical columns (pc, ma) and sixteen numerical columns (m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14). The missing values in columns ('ld', 'm0', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7') were replaced with the median value, while the remaining columns ('m8', 'm9', 'm10', 'm11', 'm12', 'm13', 'm14') were imputed with the mean value using a simple imputer. The Multinomial Naive Bayes classifier is a probabilistic algorithm that assumes independence between the features. It is commonly used for text classification tasks but can also handle categorical and numerical features. The model calculates the probabilities of each class given the features and selects the class with the highest probability as the predicted value. After training the Multinomial Naive Bayes classifier on the dataset, the model was evaluated based on performance metrics such as accuracy, precision, recall, or F1 score. The evaluation results demonstrated the classifier's effectiveness in predicting the values in the "pred" column. Finally, the predictions made by the model were saved in a CSV file named "submission.csv." This file contains the predicted values for the "pred" column based on the input data and the trained Multinomial Naive Bayes classifier.

7/8/2023
37 views

Tags:  

#python 

#machine-learning