• Skip to main content

Annielytics.com

I make data sexy

  • About
  • Tools
  • Blog
  • Portfolio
  • Contact
  • Log In

Apr 27 2024

Naive-Bayes Classifier

In this script, I built a simple decision tree classifier to predict categories based on structured input data. I started by loading a labeled dataset, splitting it into features and a target variable, and then dividing it into training and test sets to evaluate performance. I trained the model on 75% of the data and used the remaining 25% to test how accurately it could make predictions, using scikit-learn’s accuracy_score to quantify results.

But a classifier like this could be used in business to quickly categorize customer profiles, flag potentially risky transactions, or segment products based on shared attributes, enabling faster decision-making and more targeted strategies without relying on manual classification or paying for a gen AI model to do the analysis.

Written by

Copyright © 2025