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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import json | |
import urllib2 | |
import urllib | |
import os | |
import glob | |
import PIL | |
import leargist |
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 cv2 | |
import numpy as np | |
def unique(a): | |
""" remove duplicate columns and rows | |
from http://stackoverflow.com/questions/8560440 """ | |
order = np.lexsort(a.T) | |
a = a[order] | |
diff = np.diff(a, axis=0) | |
ui = np.ones(len(a), 'bool') |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import csv | |
import codecs | |
import numpy as np | |
import MeCab | |
from sklearn.feature_extraction.text import TfidfVectorizer | |
from sklearn.cluster import KMeans, MiniBatchKMeans |