Giter Site home page Giter Site logo

election-prediction's Introduction

Election-Prediction

A Keras model to predict who will win Donald Trump or Hillary Clinton in a county depending on various features like 'Per capita income' , 'Total hoseholds' , 'Unemployemnt rate' , etc. in that county.

Datasets

Datasets used are in the folder 'data'.

Requirements

1.) Keras with Tensorflow backend

2.) Numpy

3.) Pandas

How to Run

To execute the code, just run the main.py file. It will call the required model for training and testing.

Results

Statistics at Epoch 100/100: loss: 0.2149, acc: 0.7580, val_loss: 0.2139, val_acc: 0.8361

It is observed that increasing the number of epochs increases accuracy and further decreases loss.

The dropouts also allowed significant improvement (by several %). This is because with using Dropouts, I was able to avoid overfitting.

I also set differing number of units when calling Dense() on each layer. This adjusted the dimension of the output. I noticed that when I steadily increase, then decrease the number of units across my layers the accuracy improved.

Through these changes and adjustments, my validation accuracy went up to around 83% with 100 epochs. It is important to note that the training accuracy stayed at around 76%. This is due to the Droputs. Therefore, it is a good sign that the validation accuracy is higher than the training accuracy: this proves that Dropouts alone improve the accuracy by several %.

Images

Epoch 1-4

alt txt

Epoch 5-8

alt txt

Epoch 9-10

alt txt

Epoch 98-100

alt txt

election-prediction's People

Contributors

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