Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
61 views

Breast Cancer Detection Using Python & Machine Learning

This document discusses building a machine learning model to classify breast cancer diagnoses as benign or malignant using Python. It describes cleaning the patient data, extracting attributes about cells, and training various models on the data. The models' performance is evaluated using metrics like precision, recall, and accuracy calculated on a test dataset using a confusion matrix. The goal is to use these techniques to accurately diagnose breast cancer patients.

Uploaded by

Hager Elzayat
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

Breast Cancer Detection Using Python & Machine Learning

This document discusses building a machine learning model to classify breast cancer diagnoses as benign or malignant using Python. It describes cleaning the patient data, extracting attributes about cells, and training various models on the data. The models' performance is evaluated using metrics like precision, recall, and accuracy calculated on a test dataset using a confusion matrix. The goal is to use these techniques to accurately diagnose breast cancer patients.

Uploaded by

Hager Elzayat
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Breast Cancer Detection Using

Python & Machine Learning


Problem Statement

 My aim is to diagnose patients with breast cancer by


analyzing the data of patients and classifying them into
two categories, having diagnosis results as : (1) Benign(B)
and (2) Malignant(M)
Libraries Used
Details of Data
Attributes(Information about Cells)
Clean Data:

 1-No missing attributes


 2-No outliers
 3-No unreliable features  outlier
Bundling the model
Model training
Confusion matrix
predicted

positive
negative positive
positive
Tn Fn
negative

Fn Tp
positive
Precision and Recall

 from sklearn.metrics import classification_report
 from sklearn.metrics import accuracy_score
Precision Recall

How many selected How many relevant for i in range(len(model)):
items are relevant items are selected    print('Model ',i)
Tp/(Tp+Fp) Tp/(Tp+Fn)    #Check precision, recall, f1-score
   print( classification_report(Y_test, model[i].pre
dict(X_test)) )
   #Another way to get the models accuracy on the
 test data
   print( accuracy_score(Y_test, model[i].predict(
X_test)))
   print()#Print a new line
 from sklearn.metrics import classification_report
 from sklearn.metrics import accuracy_score

for i in range(len(model)):
   print('Model ',i)
   #Check precision, recall, f1-score
   print( classification_report(Y_test, model[i].predict(X_test)) )
   #Another way to get the models accuracy on the test data
   print( accuracy_score(Y_test, model[i].predict(X_test)))
   print()#Print a new line

You might also like