This repository hosts the implementation of classification trees, bagging, and random forests as part of the "Data Mining" course at Utrecht University. The goal of this project is to develop functions from scratch to grow a classification tree and predict class labels for given attributes. (see assignment1.pdf for more description)
main.py: The Python script containing the core algorithms for tree growing and prediction.dataset/: Folder containing the dataset used for training and testing the models.
Make sure you have Python installed on your system and then run:
python main.pyThe code is organized into functions as follows:
- tree_grow: Function to grow a classification tree.
- tree_pred: Function to predict class labels using the tree.
- tree_grow_b: Function for bagging implementation.
- tree_pred_b: Function to predict labels using bagged trees.
- Email: masoud.aghayan64@gmail.com.
- Linkedin: Masoud Aghayan.
Special thanks to the "Data Mining" course instructors and colleagues at Utrecht University for their guidance and valuable input throughout this project.