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 -*- | |
from gensim.models.doc2vec import Doc2Vec | |
from gensim.models.doc2vec import TaggedDocument | |
import sys | |
def create_model(train_data, model_name): | |
with open(train_data, 'r') as f: |
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 -*- | |
from gensim import corpora | |
from gensim import models | |
from scipy import spatial | |
import numpy as np | |
import csv | |
import sys |
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 urllib.request | |
import sys | |
import os | |
import json | |
def merge_by_image_id(import_file): | |
merged_images = [] | |
f = open(import_file, 'r') | |
json_data = json.load(f) |
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 urllib.request | |
import sys | |
import os | |
import json | |
def download(import_file, number_of_files): | |
f = open(import_file, 'r') | |
json_data = json.load(f) | |
images = json_data["images"] |
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
# coding: utf-8 | |
import numpy as np | |
from im2col import im2col | |
class Convolution: | |
def __init__(self, W, b, stride=1, pad=0): | |
self.W = W | |
self.b = b | |
self.stride = stride | |
self.pad = pad |
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 numpy as np | |
from node import _Node | |
from sklearn.base import ClassifierMixin | |
class DecisionTree(ClassifierMixin): | |
def __init__(self): | |
self._root = None | |
def create_tree(self, X, y): |
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
if __name__ == '__main__': | |
from sklearn import datasets | |
from sklearn.model_selection import train_test_split | |
from random_forest import RandomForest | |
iris = datasets.load_iris() | |
X = iris.data | |
y = iris.target | |
X_train, X_test, y_train, y_test = train_test_split( |
NewerOlder