Build a decision tree classifier to predict whether a customer will purchase a product or service based on their demographic and behavioral data. Use a dataset such as the Bank Marketing dataset from the UCI Machine Learning
This repository contains code for building a decision tree classifier to predict whether a customer will purchase a product or service based on their demographic and behavioral data. The classifier is trained using the Bank Marketing dataset obtained from the UCI Machine Learning Repository.
The Bank Marketing dataset consists of demographic and behavioral data of customers, including features such as age, job, marital status, education, balance, housing loan status, etc. The target variable indicates whether a customer subscribed to a product or service (yes/no).
The dataset is fetched programmatically using the ucimlrepo
library, which simplifies the process of downloading datasets from the UCI Machine Learning Repository.
- Data Preparation: Load the dataset using the
fetch_ucirepo
function from theucimlrepo
library. - Feature Selection/Engineering: Select relevant features or engineer new features if needed.
- Split Data: Divide the dataset into training and testing sets.
- Model Training: Train a decision tree classifier on the training data.
- Model Evaluation: Evaluate the performance of the trained model on the testing data.
- Visualization: Visualize the decision tree for interpretation.
- Python 3.x
- ucimlrepo
- scikit-learn
- pandas
- matplotlib