This file contains hidden or 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 scipy.sparse import lil_matrix, csr_matrix | |
from scipy.sparse.csgraph import maximum_bipartite_matching | |
import random | |
N = 10 | |
M = 10 | |
random.seed(0) | |
for x in range(5): | |
mat = lil_matrix((N, M)) |
This file contains hidden or 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 | |
require 'json' | |
require 'time' | |
require 'digest/md5' | |
srand(0) | |
data = JSON.load(open("#{__dir__}/checkins.json").read) | |
output_file = "#{__dir__}/checkins.ics" |
This file contains hidden or 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 | |
import chainer | |
from chainer import functions as F | |
from chainer import links as L | |
class NFMClassifier(chainer.Chain): | |
def __init__(self, n_feature, n_dim_emb, n_dim_1, n_dim_2): | |
np.random.seed(6162) | |
self.n_feature = n_feature |
This file contains hidden or 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 xgboost import XGBClassifier | |
model = XGBClassifier(seed = 1) | |
# XOR Pattern | |
train_data = [ | |
[1, 0], | |
[0, 1], | |
[1, 1], | |
[0, 0], |
This file contains hidden or 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
# Version: 0.6a2 | |
from xgboost import XGBRegressor | |
model = XGBRegressor(seed = 1) | |
# XOR pattern + [0, 0, 0] | |
train_data = [ | |
[1, 0] + [0] * 3, | |
[0, 1] + [0] * 3, | |
[1, 1] + [0] * 3, |
This file contains hidden or 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 ruby | |
# cat data.tsv | ccut -d delim -c name,name,name... | |
require 'trollop' | |
opts = Trollop::options do | |
opt :delim, 'delimitor', default: "\t" | |
opt :column, 'column name(s)', type: String | |
end | |
delim = opts[:delim] |
This file contains hidden or 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 | |
import sys | |
from collections import defaultdict | |
from lmfit import minimize, Parameters | |
from sklearn.decomposition import FastICA | |
import math | |
# This script is (incomplete and buggy) implementation of | |
# The Web as a Jungle: Non-Linear Dynamical Systems for Co-evolving Online Activities, (WWW 2015). | |
# http://www.cs.kumamoto-u.ac.jp/~yasuko/PUBLICATIONS/www15-ecoweb.pdf |
This file contains hidden or 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
require 'json' | |
class Hoge | |
def initialize | |
@a=1 | |
@b='hoge' | |
@c={:a => 1} | |
end | |
def to_json |
This file contains hidden or 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
// Generated by CoffeeScript 1.9.2 | |
(function() { | |
module.exports = function(robot) { | |
return robot.hear(/mecab (.*)/i, function(msg) { | |
var MeCab, mecab, ret, text; | |
text = msg.match[1]; | |
MeCab = new require('mecab-async'); | |
mecab = new MeCab(); | |
ret = mecab.parseSync(text); | |
return msg.send(text); |
This file contains hidden or 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
module.exports = (robot) -> | |
robot.hear /mecab (.*)/i, (msg) -> | |
text = msg.match[1] | |
MeCab = new require 'mecab-async' | |
mecab = new MeCab() | |
ret = mecab.parseSync(text) | |
msg.send text |
NewerOlder