Skip to content

Instantly share code, notes, and snippets.

from sklearn.cross_validation import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import f1_score
def badFFS(X, y, nFeatures):
"""Broken forward feature selection. DO NOT USE.
This is only to demonstrate a pitfall.
Arguments
X -- matrix containing feature vectors
y -- label data
@dhesse
dhesse / gist:856d4cc9311befc81b04
Created May 14, 2015 19:42
Automated multipat glacier upload
UPLOADID=xxxxx #Replace with the id you got from initiate-multipart-upload
DONE=0
for i in x*
do
echo $i
read SIZE _ <<< $(wc -c $i)
((UPPER = SIZE + DONE - 1))
aws glacier upload-multipart-part --account-id -\
--vault-name Photos --body $i --range 'bytes $DONE-$UPPER/*'\
--upload-id $UPLOADID