[go: up one dir, main page]

Skip to content

This Python script uses TensorFlow to build, train, and evaluate a neural network for breast cancer diagnosis. It processes a dataset (cancer.csv), splits it into training and testing sets, and defines a sequential model with three sigmoid-activated dense layers. Users can train the model or evaluate it via an interactive command-line interface.

License

Notifications You must be signed in to change notification settings

JimmyVS/TumorDetectionAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Breast Cancer Diagnosis with Neural Networks

Python Version

image

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).

Description

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.

Requirements

  • Python 3.x
  • pandas
  • scikit-learn
  • tensorflow

Installation

  1. Clone the repository:
    git clone https://github.com/JimmyVS/TumorDetectionAI.git
  2. Navigate to the project directory:
    cd TumorDetectionAI
  3. Install the required packages:
    pip install pandas scikit-learn tensorflow

Usage

  1. Ensure you have the cancer.csv dataset in the project directory.
  2. Run the script:
    set PYTHONIOENCODING=UTF-8
    python TumorDetection.py
  3. Follow the interactive prompts to train or test the model.

Dataset

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.

Script Overview

  • 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.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This Python script uses TensorFlow to build, train, and evaluate a neural network for breast cancer diagnosis. It processes a dataset (cancer.csv), splits it into training and testing sets, and defines a sequential model with three sigmoid-activated dense layers. Users can train the model or evaluate it via an interactive command-line interface.

Topics

Resources

License

Stars

Watchers

Forks

Languages