Skip to content

AnushkaPhogat16/Cancer-Cell-Classification-using-Naive-Bayes-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Cancer-Cell-Classification-using-Naive-Bayes-Algorithm

Introduction

In the realm of medical diagnostics, this Cancer Cell Classification project leverages the Naive Bayes algorithm to classify cancer cells into malignant or benign categories. By analyzing datasets suitable for various types of cancer, this project aims to assist in accurate diagnosis and prognosis.

Features

  • Implements the Naive Bayes algorithm for binary classification of cancer cells.
  • Utilizes the Breast Cancer Wisconsin (Diagnostic) dataset as an example, demonstrating methodology applicability across different cancer types.
  • Includes data preprocessing steps such as loading, feature extraction, and splitting into training and testing sets.
  • Evaluates model performance using accuracy metrics to assess classification effectiveness.

Usage

Importing Necessary Modules and Dataset:

To begin, import essential modules required for the project, including Scikit-learn, a powerful library for machine learning in Python. The dataset used in this project is loaded using Scikit-learn's load_breast_cancer function, which provides access to the Breast Cancer Wisconsin (Diagnostic) dataset.

Organizing the Data and Examining It:

Once the dataset is loaded, organize it into relevant variables such as features and labels. This step helps in understanding the structure and content of the dataset. Print out details like label names, labels themselves, feature names, and the actual feature data to gain insights into the dataset's composition and format.

Organizing the Data into Sets:

Split the dataset into training and testing sets using Scikit-learn's train_test_split function. This division allows for evaluating the performance of the trained model on unseen data, thereby ensuring robustness and reliability.

Building the Model:

Import the Gaussian Naive Bayes classifier (GaussianNB) from Scikit-learn and initialize it. Train the classifier using the training data previously split into train and train_labels. This step involves feeding the model with data to learn patterns and relationships between features and labels.

Making Predictions and Evaluating Accuracy:

After training the Naive Bayes classifier, use it to make predictions on the test data (test). Assess the accuracy of the predictions against the actual test labels (test_labels) using Scikit-learn's accuracy_score function. This metric provides a quantitative measure of how well the model performs in classifying cancer cells as malignant or benign based on the dataset provided.

Conclusion

This project successfully applies the Naive Bayes algorithm to classify cancer cells as malignant or benign using the Breast Cancer Wisconsin dataset. By achieving high accuracy in predicting tumor classifications, it demonstrates the potential of machine learning in enhancing medical diagnostics and decision-making processes.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published