Skip to content

Instantly share code, notes, and snippets.

View cheevahagadog's full-sized avatar

Nathan Cheever cheevahagadog

  • Salt Lake City, UT
View GitHub Profile
@cheevahagadog
cheevahagadog / month_dict.json
Last active June 20, 2018 20:39
Month dict
{"January": 1, "February": 2, "March": 3, "April": 4, "May": 5, "June": 6, "July": 7, "August": 8, "September": 9, "October": 10, "November": 11, "December": 12}
@cheevahagadog
cheevahagadog / extract_feature_effect_per_prediction.py
Last active November 17, 2020 05:36
Builds off the SHAP package to list out the feature effects per row on an XGBoost model.
#!/usr/bin/env python
# Python 3.6.4
import numpy as np
import pandas as pd
import iml
import xgboost
import shap
from tqdm import tqdm
@cheevahagadog
cheevahagadog / requestium_in_cloud_demo.py
Last active February 5, 2019 18:23
A brief example of using Requestium in a cloud environment while setting the download directory and waiting for files to download.
# Note this is designed to run for Python 3.6
# -- Pre reqs:
# 1. Install Python (I like using Miniconda, version 3.6)
# 2. Install Git
# 3. Install a chromedriver
# 4. Install Chrome
# 5. Install Python dependencies
from pyvirtualdisplay import Display # For headless browsing