Skip to content

Instantly share code, notes, and snippets.

View rlvoyer's full-sized avatar

Robert Voyer rlvoyer

  • Tyler Technologies
  • Seattle
View GitHub Profile
query domain diff
homeless data.cityofnewyork.us 0.368034002369
housing data.kcmo.org -0.349383730996
2006 data.kcmo.org -0.310913691903
business data.ny.gov 0.242477991954
santa monica renters rights data.smgov.net -0.218647589981
champaign data.illinois.gov -0.215919011572
parking data.kcmo.org -0.158675636039
office of engineering and construction data.baltimorecity.gov -0.141422934483
public safety data.raleighnc.gov 0.135683158642
@rlvoyer
rlvoyer / 20151012.queries.measurement_set.tsv
Last active December 23, 2015 18:36
Initial measurement set for catalog search relevance tracking
domain query count
data.nola.gov city council members 1
data.nola.gov parcels 6
data.nola.gov vacant lots 8
data.nola.gov permits 108
data.nola.gov hospitals 1
data.nola.gov schools 4
data.nola.gov grocery 4
data.nola.gov mayor office contact information 6
data.nola.gov green space 3
#include <graphlab/sdk/toolkit_function_macros.hpp>
#include <graphlab/sdk/gl_sarray.hpp>
#include <cmath>
using namespace graphlab;
gl_sarray bigram_pmi(long total_count, gl_sarray x, gl_sarray y, gl_sarray xy) {
// assert same lengths
assert(x.size() == y.size() && y.size() == xy.size());
#include <graphlab/sdk/toolkit_function_macros.hpp>
#include <graphlab/sdk/gl_sarray.hpp>
#include <cmath>
using namespace graphlab;
gl_sarray bigram_pmi(long total_count, gl_sarray x, gl_sarray y, gl_sarray xy) {
// assert same lengths
assert(x.size() == y.size() && y.size() == xy.size());

Directions for migrating a Predictive Service

  1. Create a new Predictive Service

    Be sure to give it a unique S3 state path. Pass in values for previous API keys and admin keys to the create method. And set the number of hosts as desired.

    import graphlab as gl
@rlvoyer
rlvoyer / snippet.py
Last active August 29, 2015 14:08
This stack trace demonstrates the exception I'm observing when I attempt to save a model, and then load the corresponding Predictive Object from S3.
In [48]: m = gl.logistic_classifier.create(data, target="rating")
PROGRESS: Logistic regression:
--------------------------------------------------------
Number of examples : 5 (2 positives, 3 negatives)
Number of feature columns : 2
Number of unpacked features : 2
PROGRESS: Number of coefficients : 3
PROGRESS: Starting Newton Method
--------------------------------------------------------
PROGRESS: Iter Grad-Norm Loss Step size Elapsed time
def time[R](block: => R): R = {
val t0 = System.nanoTime()
val result = block // call-by-name
val t1 = System.nanoTime / 1.0e9 // seconds
println("Elapsed time: " + (t1 - t0) + "s")
result
}