Skip to content

Instantly share code, notes, and snippets.

View cwpearson's full-sized avatar
🙀
I have approximate knowledge of many things.

Carl Pearson cwpearson

🙀
I have approximate knowledge of many things.
View GitHub Profile
#! /bin/env python
"""Convert higgs dataset from GBM-Benchmarks to libsvm format"""
import pandas as pd
with open('HIGGS.csv') as f:
num_lines = sum(1 for line in f)
print(num_lines)
#! /bin/env python
"""converting airline dataset from GBM-benchmarks to svm"""
import pandas as pd
with open('airline_14col.data') as f:
num_lines = sum(1 for line in f)
print(num_lines)
@cwpearson
cwpearson / dl-gaia.sh
Created November 1, 2018 11:29
Download gaia data release 2
#! /bin/bash
index_url="http://cdn.gea.esac.esa.int/Gaia/gdr2/gaia_source/csv/"
index_html=`curl $index_url`
while read -r line; do
# echo $line;
match=`echo $line | grep -oE 'href\="(.*.csv.gz)'`;
# echo $match;
match=${match#href=\"} ;# remove prefix starting with 'href="'
#! /bin/bash
set -e
git clone https://github.com/Masterminds/glide.git $GOPATH/src/github.com/Masterminds/glide
cd $GOPATH/src/github.com/Masterminds/glide
make build
cp -v glide ~/bin/.
@cwpearson
cwpearson / ppc64le_install_go.sh
Last active June 5, 2017 17:20
Use binary go1.8.3 to boostrap gvm and associated go1.8.3 on ppc64le
#! /bin/bash
set -e
VERSION=1.8.3
OS=linux
ARCH=ppc64le
NAME=go$VERSION.${OS}-$ARCH.tar.gz
echo "==== Downloading go..."
curl -fsS https://storage.googleapis.com/golang/$NAME -o $NAME