mpky / CBI_Project

I scraped, visualized, and then applied the Isolation Forest algorithm to data from the Iraqi Central Bank's daily dollar auction to detect anomalous auction sessions given reimposed sanctions on Iran.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CBI Project

I used Beautiful Soup to scrape down dollar auction data from the Central Bank of Iraq's website, applied the Isolation Forest algorithm, and then visualized the results in Bokeh. The goal is to see if there have been any noticeable changes in auction amounts over the past few years.

The static website for the project lives here. See writeup here detailing project context, scraping, and visualizations.

Contents:

  • data:
    • figures - screenshots of sample auction results and visualizations.
    • raw - raw scraped data in CSV format.
    • processed - cleaned data in CSV format.
  • python:
    • scraper_range1.py - script to scrape the first range of CBI data.
    • scraper_range2.py - script to scrape the second range of CBI data.
    • process.py - script to take the raw scraped data and output a cleaned dataframe.
    • streamlit_iforest.py - script that encompasses both the visualization and modeling from the notebooks in a Streamlit app.

Setup

  • Clone the repo.
  • With pwd being the repo, run pip install -r requirements.txt to set up the environment
  • source cbi_env/bin/activate will activate the environment
  • To launch the streamlit app, run streamlit run app.py

Changelog

branch==heroku 202008
Added
  • elements necessary for Heroku deployment
  • venv requirements.txt
Removed
  • Pipenv
  • Notebook files
branch==branch_4 202007
Added
  • .py file for streamlit with bokeh
  • new notebook with bokeh
  • new gif
branch==branch_3
Added
  • Further language to the README
Changed
  • Plots for better layout and export.

About

I scraped, visualized, and then applied the Isolation Forest algorithm to data from the Iraqi Central Bank's daily dollar auction to detect anomalous auction sessions given reimposed sanctions on Iran.


Languages

Language:Python 99.2%Language:Shell 0.6%Language:Procfile 0.1%