Skip to main content

Simple neural network interface including pre-trained model for the Kaggle Titanic dataset

Project description

Titanicbc

Titanicbc is a simple interface for training pytorch neural networks with custom hyper-parameters. The current version allows training a binary classifier network for the famous Kaggle Titanic dataset.

The aim of this package is to allow those with little or no neural network coding experience to learn how different hyper-parameter combinations affect neural network training. The package also includes a pre-trained neural network for demonstrating how networks make predictions once trained.

Later versions will expand the package to contain more flexible interfaces and networks for other classic datasets, including image and text datasets with convolutional and recurrent neural networks.

Installation

You can install Titanicbc from PyPI


pip install Titanicbc


How to use


Titanicbc provides a simple interface for training and using pre-trained pytorch networks via the config.yaml file.

The config.yaml file is included in the Python site-packages folder for Titanicbc. To find the python site-packages on your machine run python -m site. Once in site-packages, select the Titanicbc folder.

Once hyper-parameters have been set using config.yaml, simply run python -m Titanicbc from the command line or terminal to train a network or make predictions (depending on the value of train_new in config.yaml). The accuracy on a validation set for comparing models is displayed below the final epoch, above the prediction output and dataframe.

The predictions made by the new or existing model will be saved into the same location in site-packages/Titanicbc as output.csv. The output columns are in the Kaggle required format (the PassengerId and the prediction of whether that passenger survived).


The options for config.yaml are presented below in the following format;

option number. Key (value options)

  1. train_new (True, False) - If true, a new neural network will be trained and overwrite trained_model.pth. If False the model parameters saved in trained_model.pth will be loaded and used for predictions.

  2. hidden_dim (Integer) - Number of neurons in each of the 3 hidden layers within the network.

  3. num_epochs (Integer) - Number of passes the network will make over the training data when training a new model.

  4. learning_rate (float) - Parameter multiplied to the weight updates during stochastic gradient descent. Currently only the Adam optimiser is used.

  5. weight_init (uniform, xavier) - Tells the network which type of initialisation to use for the model weights. Xavier is currently recommended

  6. weight_decay (float) - weight decay acts as l2 regularlisation on the neural network.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Titanicbc-1.2.3.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

Titanicbc-1.2.3-py3-none-any.whl (42.9 kB view details)

Uploaded Python 3

File details

Details for the file Titanicbc-1.2.3.tar.gz.

File metadata

  • Download URL: Titanicbc-1.2.3.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for Titanicbc-1.2.3.tar.gz
Algorithm Hash digest
SHA256 4d9a0cb41975881c70bc3e8a2b04ee959d5078c4f4d0e2cae0ddf0fc6121247f
MD5 6482c17d973840130ea5bb3c1e04baf7
BLAKE2b-256 92cb8f84456b050149093c1b3df58c819618dfcf8da54f19073413724d2edd2a

See more details on using hashes here.

File details

Details for the file Titanicbc-1.2.3-py3-none-any.whl.

File metadata

  • Download URL: Titanicbc-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 42.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for Titanicbc-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9c4328b9764bbf1cf8864ea4d669837d79020b6b8981f924dfa6f407ce1480a3
MD5 ec74aaab806916a9128900416a11e6b1
BLAKE2b-256 f33368e54431e7fb8ac1aaa4e4b0fcbcc7958a64f1be0197a2c9f364fa734b94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page