Skip to content

A GUI program that predicts whether the patient has Breast Cancer or not using Machine Learning.

Notifications You must be signed in to change notification settings

swapnilgarg7/BreastCancerPredictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Breast Cancer Predictor

A GUI program that predicts whether the patient has Breast Cancer or not using Machine Learning.

Libaries Used

Tkinter

Joblib

Scikit-Learn

Numpy

Pandas

Seaborn

Matplotlib

How to run the program

First install the modules by running the following command in terminal

  pip install -r requirements.txt

Then open the BCP.ipynb jupyter notebook if you want to train the model yourself, or you can skip this step and use the pre-loaded BCP_model.joblib file.

Run all cells in the jupyter notebook. This will create your BCP_model.joblib file

Then you can run the main program by running this in terminal:

  python3 main.py

After it launches, click the Predict button so the program starts.

Then enter the values of the paramaters given and then click Submit

The program will than show a popup message box telling whether the patient has breast cancer(malignant) or not(benign)

How it works

Machine Learning

The dataset was obtained from kaggle

First the data was analysed with the help of pandas library for information and matplotlib and seaborn libraries for graphical analysis

The data was then pre-processed and then split to training and testing set.

Random Forest Classifier was used as it gave the best accuracy (94.74%) and was the most efficient model to use for this project.

After the model was trained, it was saved to a joblib file so that it can be accessed in the main GUI program

GUI

The graphical interface was made using tkinter module. When the patient's details are entered regarding the breast, these are sent to the saved ML model to predict whether the patient has cancer or not.

Depending on the result(0 or 1), a message box is displayed with the respective result.

Demo Images

Case 1 : Patient has Breast Cancer

First pic Second pic

Case 2 : Patient does not have Breast Cancer

Third pic Fourth pic

About

A GUI program that predicts whether the patient has Breast Cancer or not using Machine Learning.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published