The problem
An AI Techniques course project: tell a benign breast tumour from a malignant one using three cell-nucleus measurements, with fuzzy logic so every verdict traces back to rules a person can read. It began on a different dataset whose labels turned out to be unrelated to its inputs. Logistic regression, random forest and gradient boosting all scored 33 to 40%, no better than guessing, so I rebuilt it on the Breast Cancer Wisconsin data.
What I built
A Mamdani fuzzy inference system written from scratch in Python. Worst radius, concave points and texture are each fuzzified into Low, Medium and High. 27 IF–THEN rules cover every combination, and the clipped outputs are combined and defuzzified by centroid into a malignancy score from 0 to 100. The script walks five cases through every step, then reports accuracy, sensitivity and a confusion matrix.
Miss as few cancers as possible
The break points sit where benign and malignant values start to overlap, and a score of 50 or more counts as malignant. Across all 569 cases that gives 98.6% sensitivity, missing 3 of 212 malignant tumours, at the cost of sending some benign ones for a second look. For screening, that is the trade-off you want.
Screens


