This repository contains a Python script that uses TensorFlow to build, train, and evaluate a neural network for breast cancer diagnosis using a dataset (cancer.csv
).
The script processes the dataset by separating features and target variables, then splits the data into training and testing sets. A sequential neural network model is defined with three dense layers using the sigmoid activation function. The model is compiled with the Adam optimizer and binary cross-entropy loss function. Users can interactively choose to train the model or evaluate its performance on the test set through a simple command-line interface.
- Python 3.x
- pandas
- scikit-learn
- tensorflow
- Clone the repository:
git clone https://github.com/JimmyVS/TumorDetectionAI.git
- Navigate to the project directory:
cd TumorDetectionAI
- Install the required packages:
pip install pandas scikit-learn tensorflow
- Ensure you have the
cancer.csv
dataset in the project directory. - Run the script:
set PYTHONIOENCODING=UTF-8 python TumorDetection.py
- Follow the interactive prompts to train or test the model.
The cancer.csv
file should contain the dataset with features and a target column named diagnosis(1=m, 0=b)
where 1
represents malignant and 0
represents benign diagnoses.
This repository already contains a dataset. You can change it whenever you want, but make sure to add the required features.
- Loading and Preparing Data: Loads the dataset and preprocesses it.
- Model Definition and Compilation: Defines and compiles the neural network.
- Training and Testing Functions: Encapsulates training and evaluation logic.
- Interactive Menu: Allows users to train or test the model based on user input.
This project is licensed under the MIT License - see the LICENSE file for details.