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 urllib | |
import json | |
import datetime | |
import os | |
import time | |
# http://www.kbremner.com/2014/03/15/kickstarter-part1.html | |
# https://github.com/markolson/kickscraper/wiki/Project |
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
days, input_load, worker_stacks, total_stacks, output, ave_lead_time | |
case 100% input 1...6 | |
0 2 [2, 0, 0, 0, 0] 2 0 5 | |
1 5 [5, 2, 0, 0, 0] 7 0 6 | |
2 2 [2, 5, 2, 0, 0] 9 0 6 | |
3 3 [3, 5, 2, 2, 0] 12 0 6 | |
4 3 [3, 4, 4, 2, 2] 15 0 7 | |
5 6 [6, 3, 4, 5, 1] 19 2 8 | |
6 1 [4, 3, 6, 1, 5] 19 1 8 | |
7 4 [4, 4, 3, 6, 2] 19 4 8 |
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 multiprocessing | |
import traceback | |
import random | |
import time | |
import sys | |
def random_error_func(x): | |
n = random.random() |
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 | |
# ε-Greedy base multi-armed bandit | |
import random | |
slotmachine_rate = [3, 5, 10, 20, 16, 15, 21, 22, 6] | |
score_map = [[0.0, 0] for i in xrange(len(slotmachine_rate))] | |
search_rate = 0.1 |
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
# https://www.kaggle.com/c/otto-group-product-classification-challenge/details/evaluation | |
def print_kaggle_score(label_list, proba_result): | |
label_index = sorted(list(set(label_list))) | |
score = - 1.0 / len(label_list) * sum( | |
[ | |
math.log( | |
max(min( | |
proba_result[i][label_index.index(label_list[i])] | |
/ sum(proba_result[i]) |
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 os.path | |
import shutil | |
import random | |
import math | |
import cPickle | |
import pickle |
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 urllib | |
import json | |
import datetime | |
import os | |
import time | |
# http://www.kbremner.com/2014/03/15/kickstarter-part1.html | |
# https://github.com/markolson/kickscraper/wiki/Project |
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 urllib.request | |
import json | |
import datetime | |
import os | |
import time | |
try: | |
os.mkdir("result") | |
except: |
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
package main | |
import ( | |
"fmt" | |
"image/color" | |
"log" | |
"math" | |
"github.com/hajimehoshi/ebiten" | |
"github.com/hajimehoshi/ebiten/ebitenutil" |
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
https://twitter.com/tenhouginsama/status/910099478165590016 | |
https://pbs.twimg.com/media/DKFSpDTVYAAuKV_.jpg | |
===== ==== ================= ======================= | |
子供1 子供2 女の子はいますか? もう一人も女の子ですか? | |
===== ==== ================= ======================= | |
男 男 いいえ ---- | |
女 男 はい いいえ | |
男 女 はい いいえ | |
女 女 はい はい |