top of page
Completed
Wellesley High School
Breast Cancer Predication Algorithm with Java
Using AP CSA (Computer Science Advanced) knowledge to create an algorithm that can categorize breast cancer tumors as low, moderate, or high risk of malignancy.
TIMELINE
2026
FIELD
Data science &
Computer science
ROLE
Student Researcher
STATUS
Completed
PROJECT OVERVIEW
In this project, I sourced a famous breast cancer dataset from the University of Wisconsin to help classify a new tumor as low, medium, or high risk based off the following variables:
1. Area
2. Texture
3. Concavity
4. Concavity points
Though I also considered:
5. Smoothness
6. Perimeter
7. Radius
Click HERE to find the dataset I used on Kaggle.
In the dataset, most variables are in decimal form (ie. smoothness = local variation in radius length, concavity = severity of concave portions of contour), which makes them numerically interpretable. Input values correspond to features extracted from digitized images of fine needle aspirates (FNA) of breast masses in the Wisconsin Diagnostic Breast Cancer dataset.
My program has two main classes: CancerAnalysis and Patient. The prior contains the main class and performs all the computations, while the latter creates an object for each patient with their individual parameters.
CODE OVERVIEW
THE SCORING SYSTEM
HOW ARE TUMORS SCORED?
The scoring system goes from 0-7, with higher scores corresponding to higher risk. The scale is:
0 - 1 = low risk
2 - 4 = medium risk
5 - 7 = high risk
Variables earn points depending on where they stand compared to low/high cutoffs. These cutoffs are determined by averages––the low cutoff is the average for the benign tumors in the dataset, while the high cutoff is the average for the malignant ones. However, the variables are weighed a bit differently, so they are not scored the same in relation to the cutoffs. The table below shows exact scoring:

FUTURE WORK
This program was submitted as my final project for AP CSA (Computer Science Advanced) at my high school, so I had limited time and resources to complete it. If I had more time, here are some improvements I could have made:
- Adjusted scoring to better represent low-risk tumors
- Learned how to integrate machine learning models, completely abandoning the averaging process (though this wouldn't be within the scope of AP CSA)
- Tested other variables within the dataset to see if they had a more significant transcriptional effect than initially assumed
Overall, however, I am proud of how the project turned out and the effort that went into it.
Thank you for reading! Contact me if you have any questions.
bottom of page