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
a x:0.5488135039273248 y:0.7151893663724195 | |
b x:-0.6027633760716439 y:0.5448831829968969 | |
c x:-0.4236547993389047 y:-0.6458941130666561 | |
d x:0.4375872112626925 y:-0.8917730007820798 | |
a x:0.9636627605010293 y:0.3834415188257777 | |
b x:-0.7917250380826646 y:0.5288949197529045 | |
c x:-0.5680445610939323 y:-0.925596638292661 | |
d x:0.07103605819788694 y:-0.08712929970154071 | |
a x:0.02021839744032572 y:0.832619845547938 | |
b x:-0.7781567509498505 y:0.8700121482468192 |
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
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <unordered_map> | |
#include <vector> | |
#include <string> | |
#include <algorithm> | |
#include <boost/random.hpp> | |
#include <iomanip> |
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
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <unordered_map> | |
#include <vector> | |
#include <string> | |
#include <algorithm> | |
typedef std::pair<int, int> key; |
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
# GMM (generalized Mixture Model) of EM | |
# usage | |
# gmm = GMM.new([1, 2, 3, 5, 2, 1, 10, 20, 30, 20], {k: 2}) | |
LIM = 10 ** -5 | |
PROB_LIM = 10 ** -100 | |
def dist(x, mu, sigma) | |
prob = 1.0 / (2 * Math::PI * sigma) ** 0.5 * Math::exp(-(x - mu) ** 2 / (2 * sigma)) | |
# avoid p(x|mu, sigma) = 0.0 |
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 -*- | |
require 'open-uri' | |
require 'nokogiri' | |
require 'logger' | |
require 'time' | |
require 'set' | |
require 'pp' | |
UA = '' |
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
# usage: ruby ikoma.rb | pbcopy | |
require 'nokogiri' | |
require 'open-uri' | |
doc = Nokogiri::HTML(open("http://d.hatena.ne.jp/mamoruk/archive?word=&of=#{rand(1550)}", :proxy => nil).read) | |
entries = (doc/'li.archive.archive-section'/'a'); elem = entries[rand(entries.size)] | |
puts "#{elem.inner_text} #{elem.attribute('href').value}" |
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
library('ggplot2') | |
data <- read.table("/tmp/ret.csv", header = T, sep = ",") | |
data$topic_id <- as.factor(data$topic_id) | |
qplot(timestamp, gamma, data = data, color = topic_id) |
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 -*- | |
require 'nokogiri' | |
require 'open-uri' | |
require 'logger' | |
$log = Logger.new('./crawl.log') | |
def get(num) | |
ret = [ ] | |
url = "http://shasetsu.ps.land.to/index.cgi/event/#{num}/" |
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
0 | 千葉紗子 | 0.144232 | |
---|---|---|---|
0 | 鈴村健一 | 0.0596967 | |
0 | 新井里美 | 0.0497514 | |
0 | 鹿野優以 | 0.0447787 | |
0 | 井上喜久子 | 0.0422924 | |
0 | 松本大 | 0.0373197 | |
0 | 私市淳 | 0.0373197 | |
0 | 倉田雅世 | 0.0348334 | |
0 | ゆかな | 0.0348334 | |
0 | 石田彰 | 0.0248881 |
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
0 | 明坂聡美 | 0.0740566 | |
---|---|---|---|
0 | 伊瀬茉莉也 | 0.0673262 | |
0 | 南條愛乃 | 0.0561089 | |
0 | 保村真 | 0.0471351 | |
0 | 岸尾だいすけ | 0.0426482 | |
0 | 高森奈津美 | 0.0359178 | |
0 | 片岡あづさ | 0.0336743 | |
0 | 福井裕佳梨 | 0.0336743 | |
0 | 三森すずこ | 0.0336743 | |
0 | 金元寿子 | 0.0291874 |