Skip to content

Instantly share code, notes, and snippets.

View spencercarter's full-sized avatar

Spencer spencercarter

View GitHub Profile
@spencercarter
spencercarter / xgboost_permission_fail.py
Last active January 28, 2018 18:21
Sample code to create silent permission failure in xgboost 0.4
import xgboost as xgb
import numpy as np
from subprocess import call
# Initialize
X = np.random.normal(size=[10, 5])
y = np.random.randint(0,2,10)
dtrain = xgb.DMatrix(X, label=y)
# Model
@spencercarter
spencercarter / model_web_service_flask_post_p1.py
Last active November 16, 2018 13:59
Gists containing code to run the Models as a Web Service blog post
# Part 1: Model
import sklearn as sk
import numpy as np
from sklearn.datasets import load_boston
from sklearn.linear_model import LassoCV
import pandas as pd
from flask import Flask
from flask import request
import requests