#Round 4: The Christmas Invasion
Time to wrap up the Christmas Invasion and put a bow on it... Here are all the good things we saw, in non-random order!
- Aaron talked about lots of graphs made from NYC test scores.
import tensorflow as tf | |
w = tf.Variable([2.0]) | |
b = tf.Variable([2.0]) | |
x = tf.constant([1.0]) | |
y = tf.sigmoid(w*x + b) | |
y_ = tf.constant([0.0]) | |
cross_entropy = -1*(y_*tf.log(y) + (1-y_)*(tf.log(1-y))) | |
s = tf.Session() | |
s.run(tf.initialize_all_variables()) |
import csv | |
r = csv.reader(open('train.csv','r')) | |
r.next() | |
edges = set() | |
#commutative_graph = dict() | |
for edge in r: | |
edges.add((edge[0], edge[1])) | |
# commutative_graph.setdefault(edge[0], set()).add(edge[1]) |
#Round 4: The Christmas Invasion
Time to wrap up the Christmas Invasion and put a bow on it... Here are all the good things we saw, in non-random order!
#Round 3: Hack... to the Future!
And now, a wrap-up... in random order!
set.seed(54) | |
n <- rnorm(3000,0.5,0.1) | |
par(mar=c(1,1,3,1)) | |
hist(c(runif(10000),runif(1900,0.35,0.65),n[abs(n-0.5)<0.15]), | |
xlim=c(0,1),ylim=c(0,600),breaks=51,ylab="",#main="", | |
main="Statistical Programming DC",col="#C9242D", | |
axes=F, cex.main=2) |
movie_reviews = dict() | |
for line in open('movies.txt.small'): | |
pieces = line.split(':') | |
if len(pieces) > 1: | |
key = pieces[0] | |
value = ':'.join(pieces[1:]).strip() | |
if key == 'product/productId': | |
id = value | |
if key == 'review/text': | |
movie_reviews.setdefault(id, []).append(value) |
oh nothing, nothing...
This d3.js visualization uses public data from NYC public schools. Original data available largely at http://schools.nyc.gov/Accountability/tools/report/default.htm This is a hacked-together prototype; it does not represent best practices.
This shows New York City subway usage based on turnstile data. Hovering over a day shows the number of entries through subway turnstiles in that day.
Notice the clear effects of hurricanes Irene and Sandy.
More details and source code available. Visualization based (heavily) on Mike Bostock's excellent example.
def _find_getch(): | |
# courtesy of Louis | |
# http://stackoverflow.com/questions/510357/ | |
try: | |
import termios | |
except ImportError: | |
# Non-POSIX. Return msvcrt's (Windows') getch. | |
import msvcrt | |
return msvcrt.getch |