Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rokroskar
rokroskar / image_scatter.py
Created November 18, 2015 07:48 — forked from lukemetz/image_scatter.py
Image tsne scatter plot
from tsne import bh_sne
import numpy as np
from skimage.transform import resize
from matplotlib import pyplot as plt
def gray_to_color(img):
if len(img.shape) == 2:
img = np.dstack((img, img, img))
return img
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
conf.set('spark.executorEnv.PYTHONPATH',
'/cluster/apps/spark/spark-1.4.1-bin-hadoop2.6/python/lib/py4j-0.8.2.1-src.zip:/cluster/apps/spark/spark-1.4.1-bin-hadoop2.6/python/:/cluster/home04/biol/pepatric/Software/Spark_class/spark_workshop/gutenberg')
________________________
@rokroskar
rokroskar / lasso_trained_on_demeaned_dataset.ipynb
Last active August 29, 2015 14:15
lasso trained on demeaned dataset
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rokroskar
rokroskar / single_decade_notebook.ipynb
Created December 1, 2014 17:13
single decade notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rokroskar
rokroskar / example.ipynb
Created October 22, 2014 12:27
example broken notebook/slide render
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rokroskar
rokroskar / local_bloomberg_sparkgrams.ipynb
Last active August 29, 2015 14:06
example sparkgrams package usage
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import marisa_trie
from sklearn.feature_extraction.text import CountVectorizer, _make_int_array
import numpy as np
import scipy.sparse as sp
from itertools import chain
class MarisaCountVectorizer(CountVectorizer):
"""
Extension of Scikit-learn CountVectorizer class using the
MARISA-trie python wrapper from https://github.com/kmike/marisa-trie