Description
Preparation:
install.packages(“class”)
install.packages(“gmodels”)
library(class)
library(gmodels)
We will detect prostate cancer in this lab session. Download Prostate_Cancer.csv from the course shell. The
data set contains patients who have been diagnosed with either Malignant (M) or Benign (B) cancer.
Questions:
1. Check data characteristics. Is there missing data? Prepare the data for analysis.
2. Normalize the data set.
3. Divide the data to training and testing groups.
4. Use the KNN algorithm to predict the cancer.
5. Evaluate the model performance.
1