Skip to content

Instantly share code, notes, and snippets.

View ogrisel's full-sized avatar

Olivier Grisel ogrisel

View GitHub Profile
@ogrisel
ogrisel / bench_boosted_trees.py
Last active August 29, 2015 14:21
Simple benchmark to evaluate the impact of compilers on scikit-learn
# Benchmark script for a scikit-learn model that does not use
# BLAS / LAPACK routines
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.datasets import fetch_covtype
from sklearn.cross_validation import train_test_split
from time import time
seed = 0
print("Getting covertype data...")
@ogrisel
ogrisel / Configurations_that_works.txt
Last active August 29, 2015 14:24
carlk numpy scipy mingwpy test results
All tests pass for the following setups:
- numpy on Python 3.4 64 with OPENBLAS_CORETYPE="Nehalem"
- sklearn on Python 2.7 32
- sklearn on Python 3.4 64 with OPENBLAS_CORETYPE="Nehalem"
Note: the default CORETYPE detected on those VM is "Barcelona".
def first_ten(np.uint32_t seed):
cdef double *x_data_i = NULL
cdef int *x_indices_i = NULL
cdef int x_nnz_i = 0
cdef double y_i = 0.0
cdef double sw_i = 1.0
n_samples = 100
n_features = 10
@ogrisel
ogrisel / sgemm_roofline.py
Last active August 29, 2015 14:27
Empirical roofline analysis plot using SGEMM operations in theano or numpy
import matplotlib.pyplot as plt
import pandas as pd
import theano
import theano.tensor as tt
import numpy as np
from time import time
m, k, n = 1000, 1000, 2000
A = np.random.normal(size=(m, k)).astype(np.float32)
@ogrisel
ogrisel / .gitignore
Created March 11, 2010 18:23
Image fetching and clustering / semantic coding
*.swp
*.pyc
*.png
data/*
build
@ogrisel
ogrisel / incoming-links.txt
Created April 8, 2010 17:37
Counting incoming links in DBpedia with unix shell tools
@ogrisel
ogrisel / .gitignore
Created April 12, 2010 14:52
t-SNE wrapper to output SVG maps
*.pyc
mnist2500*
build/
pip-log.txt
text-documents/
@ogrisel
ogrisel / out.txt
Created June 27, 2010 12:13
Random security terms generator
asynchronous buffer forging
anonymous identity injection
asynchronous SQL skewing
synchronous buffer analysis
reverse jail fuzzing
tainted state inspection
multi-modal integrity recovery
deep state engineering
social state breaking
monotonic state forging
#!/bin/bash
sudo apt-get update
sudo apt-get install -y byobu couchdb python-pip python-lxml
sudo pip install -U tweepy couchdbkit restkit
@ogrisel
ogrisel / enet_whitening.py
Created December 13, 2010 01:15
ElasticNet and whitening
"""Evaluating the impact of PCA + whitening on low rank data"""
import numpy as np
from pprint import pprint
from scikits.learn.datasets.samples_generator import make_regression_dataset
from scikits.learn.pca import PCA
from scikits.learn.linear_model import ElasticNetCV
data_opts = {
'n_train_samples': 5000,