This repository contains code that performs breast cancer classification using a decision tree classifier. The code utilizes the scikit-learn library for machine learning tasks and includes grid search to find the optimal hyperparameter for the decision tree classifier.
The breast cancer dataset used in this code is available in the scikit-learn library. It consists of 569 samples with 30 features each. These features are computed from a digitized image of a fine needle aspirate (FNA) of a breast mass. They describe various characteristics of the cell nuclei present in the image. The target variable indicates whether the breast mass is malignant (0) or benign (1).
- Load the breast cancer dataset.
- Split the dataset into training and testing sets.
- Perform grid search to find the best hyperparameter for the decision tree classifier.
- Fit the decision tree classifier on the training data using the best hyperparameter.
- Make predictions on the test set.
- Display the confusion matrix to evaluate the performance of the classifier.
- Print the accuracy of the classifier.