Skip to content

Instantly share code, notes, and snippets.

View coreylynch's full-sized avatar

Corey Lynch coreylynch

  • Google
  • Honolulu, HI
View GitHub Profile
@coreylynch
coreylynch / profile.sh
Created October 4, 2012 18:48 — forked from joferkington/profile.sh
Brute force memory monitor
# /bin/sh
# Setup
datfile=$(mktemp)
echo "ElapsedTime MemUsed" > $datfile
starttime=$(date +%s.%N)
# Run the specified command in the background
$@ &
@coreylynch
coreylynch / get_lat_lon_exif_pil.py
Created November 16, 2012 19:42 — forked from erans/get_lat_lon_exif_pil.py
Get Latitude and Longitude from EXIF using PIL
from PIL import Image
from PIL.ExifTags import TAGS, GPSTAGS
def get_exif_data(image):
"""Returns a dictionary from the exif data of an PIL Image item. Also converts the GPS Tags"""
exif_data = {}
info = image._getexif()
if info:
for tag, value in info.items():
decoded = TAGS.get(tag, tag)
@coreylynch
coreylynch / bench_rcv1.py
Created November 26, 2012 22:07 — forked from pprett/bench_rcv1.py
Benchmark sklearn's SGDClassifier on RCV1-ccat dataset.
"""
Benchmark sklearn's SGDClassifier on RCV1-ccat dataset.
So generate the input files see http://leon.bottou.org/projects/sgd .
Results
-------
ACC: 0.9479
AUC: 0.9476
@coreylynch
coreylynch / bench_rocsgd.py
Created November 26, 2012 22:08 — forked from pprett/bench_rocsgd.py
Benchmark sklearn RankSVM implementations (now with sofia binding benchmarks)
import itertools
import numpy as np
from sklearn.linear_model import SGDClassifier, SGDRanking
from sklearn import metrics
from minirank.compat import RankSVM as MinirankSVM
from scipy import stats