Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View EnTeQuAk's full-sized avatar

Christopher Grebs EnTeQuAk

  • Mozilla
  • Berlin, Germany
View GitHub Profile
@dcramer
dcramer / gist:3898601
Created October 16, 2012 10:40
pmp Concept
@amueller
amueller / find_param_names.py
Created October 7, 2012 20:06
find parameter names for sklearn estimators
from sklearn.utils.testing import all_estimators
import numpy as np
all_objects = []
for C in all_estimators():
try:
all_objects.append(C[1]())
except:
pass
params = [c.get_params().keys() for c in all_objects]
@amueller
amueller / digits_video.py
Created October 5, 2012 19:13
Visualization of iris and digits datasets via random projections
# (c) 2012 Andreas Mueller amueller@ais.uni-bonn.de
# License: BSD 2-Clause
#
# See my blog for details: http://peekaboo-vision.blogspot.com
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
@amueller
amueller / chi2_p_value.py
Created September 4, 2012 14:46
chi2_p_value
import numpy as np
from sklearn.feature_selection import chi2
data = np.load("values.npy")
labels = np.load("labels.npy")
print(chi2(data, labels))

Hey guys,

I'm selling all my Canon and Fuji gear. I'm insane and picking up a used Leica M9 + Voigtlander 35mm f/1.2 II.

For sale:

  • Canon 5D Mark II ($1,750)
  • Canon 85mm f/1.2L II ($1800)
@andkerosine
andkerosine / raskell.rb
Created August 15, 2012 05:56
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@amueller
amueller / gist:3297265
Created August 8, 2012 18:20
lbp error
======================================================================
FAIL: test_texture.TestLBP.test_default
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/andy/checkout/scikits.image/skimage/feature/tests/test_texture.py", line 163, in test_default
np.testing.assert_array_equal(lbp, ref)
File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 707, in assert_array_equal
verbose=verbose, header='Arrays are not equal')
@amueller
amueller / binary_trees.py
Created August 1, 2012 16:49
Traversing trees
def make_node(p, name=1):
if p == 0:
return [name]
return [name, make_node(p - 1, 10 * name + 0),
make_node(p - 1, 10 * name + 1)]
def depth_first(p):
print(p[0])
if len(p) == 3:
@dln
dln / inotify-cmake.sh
Created July 17, 2012 10:36
Continuous build on the cheap, using inotify, cmake and a terminal
#!/bin/bash
# Watch paths (given as arguments), automatically build when something changes.
# The script does a couple opinionated things to make my life easier:
#
# * Terminal scrollbuffer is reset before each iteration, simplifying scrolling.
# * I use a filter script to colorize gcc output (clang errors would be nicer).
# * Output is copied to a log file (/tmp/build.log).
# - I open this file in Sublime or vim, which reloads the file on change (each build).
#
# Usage:
@madzen
madzen / Facewall.py
Created May 15, 2012 23:19
Create an image grid from Facebook friend profile pictures
#!/usr/bin/python
###############################################################################
# Produce a collage (grid) of friend profile images from Facebook.
# Inspired by Vipin "swvist" Nair @ https://gist.github.com/2692786
###############################################################################
# Copyright (c) 2012 Madzen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal