Coders Packet

Breast Cancer Diagnosis Tool

By Rachit Singh

This project uses Logistic Regression on the Wisconsin Breast Cancer Dataset (569 samples, 30 features) to predict tumor malignancy, integrated into a Streamlit app for real-time diagnosis.

Breast Cancer Diagnosis Tool

This project applies Logistic Regression to predict whether a tumor is malignant or benign using the Wisconsin Breast Cancer Dataset. With 30 features from 569 observations, the model is integrated into a Streamlit web app for real-time tumor diagnosis.

Flowchart

1. Function load_and_prepare_data

Algorithm:

  1. Load dataset DD from CSV.
  2. Drop unnecessary columns ('Unnamed: 32', 'id').
  3. Map 'diagnosis' column values ('M', 'B') to numerical values (1, 0).
  4. Return D′ (processed dataframe).

2. Function add_sidebar

Algorithm:

  1. For each column in D′:
    • Create a slider in the sidebar.
    • Set the range as [min, max] of , and the default as mean of k.
  2. Store slider values in input_dict.
  3. Return input_dict.

3. Function get_scaled_values

Algorithm:

  1. For each key-value pair (k,x) in :
    • Calculate min(X_k) and max(X_k).
    • Scale using the min-max scaling formula.
  2. Return containing scaled values.

4. Function get_radar_chart

Algorithm:

  1. Group input values into R_mean, R_se, R_worst.
  2. Create a radar chart with:
    • R_mean, R_se, R_worst as radii.
    • C as angular axes.
  3. Return the radar chart.

5. Function add_predictions

Algorithm:

  1. Load model and scaler from saved files.
  2. Transform input_data using the scaler.
  3. Use the model to predict y and probabilities P.
  4. Display the result (Benign or Malignant) and probabilities

Important Note: This application is designed to support medical professionals in the diagnostic process; however, it is not intended to replace a professional medical diagnosis.

(Visit the Project)

Download Complete Code

Comments

No comments yet

Download Packet

Reviews Report

Submitted by Rachit Singh (Rachit02)

Download packets of source code on Coders Packet