A GUI program that predicts whether the patient has Breast Cancer or not using Machine Learning.
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)
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.