141002/brain-tumor-mri-tda-ml ? reverse-engineered prompt
Reverse engineered prompt
Build me a notebook based project that classifies brain MRI images as tumor or non tumor using topological data analysis and machine learning.
I want the images to be loaded from a Google Drive folder, converted to grayscale, normalized, inverted, and then turned into a cubical complex so we can compute persistent homology in H0 and H1 with GUDHI. From each persistence diagram, create a 20 by 20 persistence image, combine them into one 800 feature vector, and then train and compare logistic regression, an RBF SVM, and a random forest with an 80 20 stratified split.
Please make the notebook easy to run from top to bottom in Colab, and also split the reusable parts into separate Python files for preprocessing, feature extraction, and model training if that fits the project. Include clear cells for loading data, feature extraction, training, and evaluation, plus confusion matrices and basic metrics like accuracy, precision, recall, and F1. If you need to look up current docs for the TDA library, go ahead.
Are you gonna build this?
make sure you review the code using coderabbit