Code Monkey home page Code Monkey logo

jimmyvs / tumordetectionai Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 71 KB

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: MIT License

Python 100.00%
ai breast medical python tumor-detection

tumordetectionai's Introduction

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.

tumordetectionai's People

Contributors

jimmyvs avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.