GithubHelp home page GithubHelp logo

manuelinfosec / usd-ngn-predictions Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 564 KB

this project predicts the exchange rate of the united states dollar (usd) to nigerian naira (ngn) with three machine learning models; served over a web application in real-time with the django framework.

License: MIT License

Jupyter Notebook 93.24% Python 4.75% CSS 1.07% HTML 0.94%
django machine-learning naira neural-network ngn regression svm usd

usd-ngn-predictions's Introduction

Dollar to Naira Exchange Rate Prediction

Project Objectives

This project aims to predict the exchange rate between the US Dollar and the Nigerian Naira. Three different machine learning models were built to predict the exchange rate: linear regression, Support Vector Machine (SVM), and Artificial Neural Network (ANN). The models were trained and evaluated using historical exchange rate data from 2001 to 2022.

Project Structure

  • assets/ - Holds plot images obtained during the study.
  • datasets/ - Holds the dataset used in the study.
  • production/ - Holds Django files that enables prediction in a live environment
  • production/artifcats/ - Holds contents of the compiled model.
  • production/templates - Holds html files used in the web environment.
  • production/static - Holds CSS files used in the web environment.
  • production/RequestHandler - Holds files that interface with the prediction functions.

Generating model artifacts

To run the notebook, you need to have Visual Studio Code or Jupyter Notebook installed on your computer. On Visual Studio Code, use the Jupyter extension from Marketplace to power up a kernel.

Installing dependencies

The following packages are required to run the notebook:

  • pandas
  • matplotlib
  • sklearn
  • keras

You can install all of the required packages by running the following command in your terminal:

pip install -r requirements.txt

Collecting metrics

The performance of each model was evaluated using the R2 Score metric. The higher the score, the better the model's performance.

The following figures show the actual exchange rates vs. predicted exchange rates for each model:

  • Relationship across variables: Heatmap

  • Linear Regression: Linear Regression

  • Support Vector Machine: Support Vector Machine

  • Artificial Neural Network: ANN

Making Real-time Predictions

To enable real-time predictions, the model artifacts are served in an environment powered by Django and Jinja's Template engine. To deploy the web environment locally, switch to production folder and start the web server:

cd production
python manage.py runserver

Server Log:

Server log

In a browser window, open the specified address (http://127.0.0.1:8000), specify the model to be used for prediction and passing the value to be predicted for

Web Screenshot

And there you have a successful prediction!

Conclusion

Overall, the best model for predicting the dollar to naira exchange rate was the Artficial Neural Network (ANN) model, with a R2 score of 96.66%. The Support Vector Machine (SVM) model had a R2 score of 95.50%, while the linear regression model had a a R2 score of 78.92%

usd-ngn-predictions's People

Contributors

manuelinfosec avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

richardchukwu

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.