Skip to content

Instantly share code, notes, and snippets.

@smartinsightsfromdata
smartinsightsfromdata / config.py
Created December 18, 2015 18:34 — forked from bonzanini/config.py
Twitter Stream Downloader
consumer_key = 'your-consumer-key'
consumer_secret = 'your-consumer-secret'
access_token = 'your-access-token'
access_secret = 'your-access-secret'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smartinsightsfromdata
smartinsightsfromdata / topojson-pattern.md
Created December 16, 2015 13:25
Patterns for converting shapefiles to topojson

use gdal to covert coordinate system

ogr2ogr -t_srs EPSG:4326 CCG_APR_2013_EN_BFE_WGS84.shp CCG_APR_2013_EN_BFE.shp

use topojson to simply & convert format

hires:

@smartinsightsfromdata
smartinsightsfromdata / lstm_reference.ipynb
Created December 15, 2015 17:01 — forked from Qwlouse/lstm_reference.ipynb
LSTM Reference Implementation in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smartinsightsfromdata
smartinsightsfromdata / visualizing_topic_models.py
Created December 12, 2015 10:47 — forked from tokestermw/visualizing_topic_models.py
visualization topic models in four different ways
import json
import urlparse
from itertools import chain
flatten = chain.from_iterable
from nltk import word_tokenize
from gensim.corpora import Dictionary
from gensim.models.ldamodel import LdaModel
from gensim.models.tfidfmodel import TfidfModel
@smartinsightsfromdata
smartinsightsfromdata / preprocess-twitter.py
Created December 12, 2015 10:47 — forked from tokestermw/preprocess-twitter.py
Python version of Ruby script to preprocess tweets for use in GloVe featurization http://nlp.stanford.edu/projects/glove/
"""
preprocess-twitter.py
python preprocess-twitter.py "Some random text with #hashtags, @mentions and http://t.co/kdjfkdjf (links). :)"
Script for preprocessing tweets by Romain Paulus
with small modifications by Jeffrey Pennington
with translation to Python by Motoki Wu
Translation of Ruby script to create features for GloVe vectors for Twitter data.
@smartinsightsfromdata
smartinsightsfromdata / train_doc2vec.py
Created November 21, 2015 21:52
train and infer with doc2vec
import sys
import logging
import numpy
import gensim
logging.basicConfig(level=logging.INFO)
train_sentences = gensim.models.doc2vec.LabeledLineSentence(sys.argv[1])
model = gensim.models.Doc2Vec(train_sentences, size=400, window=8, min_count=2,
@smartinsightsfromdata
smartinsightsfromdata / Whiplash for cash.adoc
Created November 13, 2015 17:33 — forked from jvilledieu/Whiplash for cash.adoc
A rundown of whiplash for cash schemes and how to use graphs to fight them
@smartinsightsfromdata
smartinsightsfromdata / Carousel fraud detection.adoc
Created November 13, 2015 17:32 — forked from jvilledieu/Carousel fraud detection.adoc
This interactive Neo4j graph tutorial shows how to detect a popular fraud scam called "carousel fraud".
@smartinsightsfromdata
smartinsightsfromdata / Reshipping scam detection.adoc
Created November 13, 2015 15:53 — forked from jvilledieu/Reshipping scam detection.adoc
A neo4j gist on reshipping and retail fraud.