Giter Club home page Giter Club logo

neuralnetwork's Introduction

NeuralNetwork

Predicting flight cancellations with a generic two-layer Artificial Neural Network

neural_network.py and activation_functions.py are generic. The artificial neural network is set to initialize to two layers, with 400 neurons in the first hidden layer and 250 neurons in the second hidden layer. This neural network architecture is configured to work with flight delays data, which load_data.py transforms into 368 binary input variables.

The neural network uses a leaky rectified linear unit activation function to compute the hidden layers, and a sigmoid activation function to compute the output layer (which is a binary classification in the case of predicting flight cancellations). It is straightforward to modify the specified activation function for the output layer (don't forget the associated derivative in back propagation), though care needs to be taken as the learning rate likely requires a lower initial value if the network is adapted to perform regression.

  • To train the artificial neural network using k-fold cross-validation, execute train_network.py in command line (k = 2 is a single train/test split; k >= 2):

    python train_network.py 2
    

    The training data file './flight_delays_data.csv' is required. The user can specify a different file at line 112. The program's default behavior is to start a new training from scratch. To resume a training, modify line 115 accordingly and specify k at line 116 for the k-fold cross-validation in progress.

  • To use a trained neural network to predict claims for delayed or cancelled flights, execute predict_claims.py in command line:

    python predict_claims.py
    

    The user will be prompted to specify the path to a .csv file with the test data. Weights for the trained network needs to be in ./state/best/.

neuralnetwork's People

Contributors

aleung12 avatar

Watchers

James Cloos 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.