Skip to content

Instantly share code, notes, and snippets.

@ageitgey
ageitgey / providers.json
Created September 18, 2020 16:45
CMS inpatient provider list from CMS's public inpatient provider pricing website
View providers.json
This file has been truncated, but you can view the full file.
[
{
"PROVIDER":"013025",
"EFF_DT":"20191001",
"FYBEGDT":"20190101",
"REPTDATE":"20200331",
"TERMDATE":"0",
"PPSWAIV":"N",
"FINUM":"10111",
View imagenet_classes.txt
List of ImageNet class numbers and names as used in Keras' pre-trained models.
Extracted from https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json
0, tench
1, goldfish
2, great_white_shark
3, tiger_shark
4, hammerhead
5, electric_ray
View dlib and face_recognition on raspberry pi.md
View installing_dlib_on_macos_for_python.md
View face detection system example.md

Before you start

Make sure you have python, OpenFace and dlib installed. You can either install them manually or use a preconfigured docker image that has everying already installed:

docker pull bamos/openface
docker run -p 9000:9000 -p 8000:8000 -t -i bamos/openface /bin/bash
cd /root/openface
View gist:c40fba50b6fece4ee1e7
import numpy as np
from sklearn import grid_search
from sklearn import cross_validation
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import SGDRegressor
# Load your starting coefficient data as an array called X. This can be as big
# as your computer's memory. If that's still not big enough, you can load it in
# segments and use partial_fit instead of fit.
View gist:1d85f8482953be37d9c3
from sklearn import linear_model
X = [
[4,3,1,0,1],
[5,2,1,0,1],
[4,2,1,1,1],
[3,1,0,1,1],
[1,1,0,1,1]
]
View gist:34f49d956a60b781f947
X = [4 3 1 0 1; 5 2 1 0 1; 4 2 1 1 1; 3 1 0 1 1; 1 1 0 1 1]
y = [4, 6, 6, 3, 1]
theta = pinv(X' * X) * X' * y'
View estimate.py
def estimate_house_sales_price(num_of_bedrooms, sqft, neighborhood):
price = 0
# In my area, the average house costs $200 per sqft
price_per_sqft = 200
if neighborhood == "hipsterton":
# some areas cost a bit more
price_per_sqft = 400
elif neighborhood == "skid row":