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 |
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 "kconv" | |
io = IO.popen("mecab", "r+") | |
io.puts "吾輩は猫である" | |
io.each{|e| | |
puts e | |
break if e.chomp == "EOS" | |
} |
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(mvpart) | |
> | |
> # 本来なら直接 | |
> # rpart(iris$Species~., iris) | |
> # とやりたいけど iris の予測すべきラベル名がわからず | |
> # データフレームの最後にあることだけはわかる,みたいな状況 | |
> | |
> # ここで最終行の列名取得 | |
> label <- colnames(iris)[ncol(iris)] |
We can't make this file beautiful and searchable because it's too large.
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
釘宮理恵,200007,0.31963575947887185 | |
釘宮理恵,200010,0.31578446348916184 | |
釘宮理恵,200012,0.31564458559250186 | |
釘宮理恵,200101,0.31531536347356165 | |
釘宮理恵,200102,0.3152865223926949 | |
釘宮理恵,200103,0.31479491969312356 | |
釘宮理恵,200104,0.5039254644570497 | |
釘宮理恵,200105,1.0558031621952395 | |
釘宮理恵,200107,1.005958003523609 | |
釘宮理恵,200110,0.9323008071023162 |
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
釘宮理恵 さんは 2001年4月頃にブレイクした…? | |
0.31479491969312356 => 0.5039254644570497, sd: 0.0014502546594198278 | |
釘宮理恵 さんは 2001年5月頃にブレイクした…? | |
0.5039254644570497 => 1.0558031621952395, sd: 0.07085797611505189 | |
釘宮理恵 さんは 2004年10月頃にブレイクした…? | |
3.352655091760327 => 5.818529948330466, sd: 0.1639852185544332 | |
釘宮理恵 さんは 2006年4月頃にブレイクした…? | |
6.181845671016907 => 8.363148049010016, sd: 0.33924422910288793 | |
子安武人 さんは 1994年4月頃にブレイクした…? | |
1.238813633722919 => 2.0370318925579873, sd: 0.14508261990005888 |
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
(defn -main [& [args]] | |
(println args)) |
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 -*- | |
# Practice of Viterbi Algorithm | |
# Data from | |
# http://www.chokkan.org/lectures/2011nlp/03nlp.pdf | |
class HMM | |
def initialize | |
@all_x = [ ] | |
@all_y = [ ] | |
@n_x_y = Hash.new{0.0} |