Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
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') | |
________________________ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 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 |