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 sys | |
import numpy as np | |
from sklearn.datasets import load_svmlight_file | |
from sklearn.ensemble import GradientBoostingClassifier | |
from sklearn.externals.joblib import Parallel, delayed | |
from sklearn.utils import array2d | |
from sklearn.tree._tree import DTYPE |
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
execfile("core.py") | |
from ts import * | |
import random | |
random.seed(1) | |
means = [0.1, 0.1, 0.1, 0.1, 0.9] | |
n_arms = len(means) | |
random.shuffle(means) | |
arms = map(lambda (mu): BernoulliArm(mu), means) | |
print("Best arm is " + str(ind_max(means))) |
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 math | |
from collections import defaultdict | |
class LR_SGD(object): | |
def __init__(self, eta=1): | |
self.w = defaultdict(float) | |
self.eta = eta | |
self.t = 0 | |
def sign(self, z): |
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 sys | |
import MeCab | |
import json | |
import unicodedata | |
m = MeCab.Tagger ("-Ochasen") | |
for l in sys.stdin: | |
l = json.loads(l) | |
l = l["comment"] |