/breast-cancer-detection

Code for classifying breast cancer tumors using machine learning. Includes preprocessing, visualizations, and models like Logistic Regression, Decision Tree, and Random Forest. Evaluated with accuracy, precision, recall, and F1-score. Clone, install dependencies, and run the Jupyter notebook for full analysis.

Primary LanguageJupyter Notebook

Breast Cancer Classification Project

This project involves the classification of breast cancer using various machine learning techniques. The dataset used contains several features extracted from breast cancer cell images.

Background Image

Table of Contents

Introduction

Breast cancer is a significant health issue affecting millions of people worldwide. Early detection and classification are crucial for effective treatment. This project aims to classify breast cancer tumors as benign or malignant based on various features extracted from cell images.

Dataset

The dataset used in this project is the Breast Cancer Wisconsin (Diagnostic) Data Set. It contains 569 samples with 30 features each, along with a target variable indicating whether the tumor is benign or malignant.

Exploratory Data Analysis

Pair Plot

The pair plot below shows the relationships between different features in the dataset. Each point represents a sample, colored according to the target variable.

Pair Plot

Count Plot

The count plot below shows the distribution of the target variable, indicating the number of benign and malignant cases.

Count Plot

Distribution of Mean Radius

The distribution plot below shows the frequency distribution of the mean radius feature.

Distribution of Mean Radius

Heatmap

The heatmap below visualizes the distribution of the feature values across the samples.

Heatmap

Correlation Matrix

The correlation matrix below shows the correlation coefficients between different features. Highly correlated features are highlighted in red.

Correlation Matrix

Feature Importance

The bar plot below shows the importance of each feature in the classification task.

Feature Importance

Model Building

We implemented several machine learning models to classify breast cancer tumors, including:

  • Logistic Regression
  • Decision Tree
  • Random Forest
  • Support Vector Machine
  • K-Nearest Neighbors

Evaluation

The models were evaluated using various metrics such as accuracy, precision, recall, and F1-score. The performance of each model was compared to select the best-performing one.

Conclusion

The project successfully classified breast cancer tumors with high accuracy using the selected machine learning models. The findings highlight the importance of certain features in the classification task, providing insights into the characteristics of benign and malignant tumors.