Skip to content

Instantly share code, notes, and snippets.

Andreas Mueller amueller

Block or report user

Report or block amueller

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@amueller
amueller / filterbank.py
Created Jul 17, 2012
Filterbank responses for low level vision
View filterbank.py
##########################################################################
# Maximum Response filterbank from
# http://www.robots.ox.ac.uk/~vgg/research/texclass/filters.html
# based on several edge and bar filters.
# Adapted to Python by Andreas Mueller amueller@ais.uni-bonn.de
# Share and enjoy
#
import numpy as np
import matplotlib.pyplot as plt
@amueller
amueller / mnist_kernel_approx.py
Last active Sep 1, 2019
Comparing Nystroem and Fourier feature based kernel approximation on MNIST
View mnist_kernel_approx.py
# Standard scientific Python imports
import pylab as pl
import numpy as np
from time import time
# Import datasets, classifiers and performance metrics
from sklearn import datasets, svm, pipeline
from sklearn.kernel_approximation import (RBFSampler,
Nystroem)
from sklearn.utils import shuffle
View mnist_kernel_approximation.py
# Standard scientific Python imports
import pylab as pl
import numpy as np
from time import time
# Import datasets, classifiers and performance metrics
from sklearn import datasets, svm, pipeline
from sklearn.kernel_approximation import (RBFSampler,
Nystroem)
from sklearn.utils import shuffle
View mnist_svm_sklearn.py
from sklearn.grid_search import GridSearchCV
from sklearn.cross_validation import StratifiedKFold
def main():
mnist = fetch_mldata("MNIST original")
X_all, y_all = mnist.data/255., mnist.target
print("scaling")
X = X_all[:60000, :]
y = y_all[:60000]
@amueller
amueller / Diagram1.dia
Last active Mar 29, 2019
Machine learning cheat sheet diagram svg and dia file
@amueller
amueller / dpgmm_sampler.py
Created Mar 10, 2012
Nonparametric Gaussian mixture model data sampling
View dpgmm_sampler.py
import numpy as np
import scipy.stats
class ChineseRestaurantProcess(object):
def __init__(self, alpha):
self.alpha = alpha
self.customers = []
def sample(self, n_samples=1):
samples = []
@amueller
amueller / gist:1351047
Created Nov 9, 2011
sklearn precomputed kernel example
View gist:1351047
from sklearn.datasets import load_digits
from sklearn.svm import SVC
from sklearn.utils import shuffle
from sklearn.metrics import zero_one_score
import numpy as np
digits = load_digits()
X, y = shuffle(digits.data, digits.target)
X_train, X_test = X[:1000, :], X[1000:, :]
@amueller
amueller / commits.py
Created Oct 26, 2018
list recent commits by author
View commits.py
from github import Github
gh = Github("SECRETKEY")
rep = gh.get_repo("scikit-learn/scikit-learn")
org = gh.get_organization("scikit-learn")
org_members = list(org.get_members())
import datetime
n_commits = {}
limit = datetime.datetime(2017, 1, 1)
@amueller
amueller / parsing_in_preparation.ipynb
Created Sep 28, 2018
parsing in preparation datasets on openml
View parsing_in_preparation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View student_groups.py
import cvxpy as cvx
n_students = 130
n_projects = 30
assignment = cvx.Int(rows=n_students, cols=n_projects)
import numpy as np
rng = np.random.RandomState(0)
project_preferences = rng.rand(n_students, n_projects)
You can’t perform that action at this time.