This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1:6379> sadd rl1 matt | |
127.0.0.1:6379> sadd rl1 ben | |
127.0.0.1:6379> sadd rl1 judy | |
127.0.0.1:6379> smembers rl1 | |
1) "judy" | |
2) "ben" | |
3) "matt" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import logging | |
import psycopg2 | |
import pandas as pd | |
import pandas.io.sql as sqlio | |
import ConfigParser | |
import argparse | |
import statistics | |
from pandas import pivot_table, crosstab | |
from datetime import datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1:6379> zadd mts-123456 20140302 5.6 | |
(integer) 1 | |
127.0.0.1:6379> zadd mts-123456 20140301 7 | |
(integer) 1 | |
127.0.0.1:6379> zadd mts-123456 20140304 3 | |
(integer) 1 | |
127.0.0.1:6379> zadd mts-123456 20140303 2.7 | |
(integer) 1 | |
127.0.0.1:6379> ZRANGEBYSCORE mts-123456 20140301 20140302 | |
1) "7" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##http://neo4j-rest-client.readthedocs.org/en/latest/info.html | |
import string | |
from neo4jrestclient.client import GraphDatabase | |
gdb = GraphDatabase("http://localhost:7474/db/data/") | |
items = open("/Users/elliottcordo/Downloads/ml-100k/u.item") | |
for row in items: | |
row = filter(lambda x: x in string.printable, row) #there are special characters that will screw things up |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--item sim | |
REGISTER '/home/hduser/libs/pig-redis.jar'; | |
raw = LOAD '/user/movie_lens_rec_item_similarity' | |
USING PigStorage('\t') as (item1:chararray, item2:chararray, rating:chararray); | |
exp_tuple = FOREACH raw GENERATE item1, TOTUPLE(item2, rating); | |
STORE exp_tuple INTO 'dummy' USING com.hackdiary.pig.RedisStorer('zset','192.168.56.1'); |
NewerOlder