Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaas3000/exercise-breast-cancer
Python feed-forward neural network to predict breast cancer. Trained using stochastic gradient descent in combination with backpropagation.
https://github.com/kaas3000/exercise-breast-cancer
breast-cancer-prediction breast-cancer-wisconsin learning-exercise machine-learning numpy
Last synced: 2 months ago
JSON representation
Python feed-forward neural network to predict breast cancer. Trained using stochastic gradient descent in combination with backpropagation.
- Host: GitHub
- URL: https://github.com/kaas3000/exercise-breast-cancer
- Owner: kaas3000
- License: mit
- Created: 2017-03-06T13:41:03.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-28T18:27:37.000Z (almost 8 years ago)
- Last Synced: 2024-08-04T10:01:25.674Z (6 months ago)
- Topics: breast-cancer-prediction, breast-cancer-wisconsin, learning-exercise, machine-learning, numpy
- Language: Python
- Homepage:
- Size: 1.25 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
- awesome-ai-cancer - kaas3000/exercise-breast-cancer - Python feed-forward neural network to predict breast cancer. Trained using stochastic gradient descent in combination with backpropagation (Code / Repositories)
README
# Basic implementation of a neural network in python
## Installation
When using virtualenv, create a new environment and activate it with
the following commands:
```shell
virtualenv .
. bin/activate
```To install the dependencies using pip run:
```shell
pip install -r requirements.txt
```## Usage
The usage is currently quite limited. The provided dataset
`res/breast-cancer-wisconsin.data` is hardcoded. A different dataset
can't be used without modifying the code.
The application can be started using the command:
```shell
python3 breast_cancer.py
```## About the application
The application will initialize a multilayered perceptron network.
This network contains an input layer of 9 neurons, followed by a
hidden layer of another 9 neurons and an output layer of 1 neuron.
The network will be trained using the backpropagation algorithm (SGD)
wich is implemented completely using only raw python and numpy arrays
and numpy array operations.## Thanks
This script is the result of an attempt to learn how neural networks work
and can be trained.
The sources used to obtain this information are:
* The CS224d course, specifically lecture 6.
([lecture](https://youtu.be/MeIrQCZvlkE?list=PLlJy-eBtNFt4CSVWYqscHDdP58M3zFHIG) ,
[notes](http://cs224d.stanford.edu/lecture_notes/notes3.pdf))
* A tutorial by Matt Mazur which explains the required calculations in
a different way ([link](https://mattmazur.com/2015/03/17/a-step-by-step-backpropagation-example/))
* Another Python/Numpy implementation by [hdmetor](https://github.com/hdmetor/NeuralNetwork).