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 MeCab | |
m = MeCab.Tagger("-Ochasen") | |
string = u"それサバンナでも同じ事言えんの?" | |
# MeCabでUnicode文字列を扱う場合は、一度エンコードする必要がある。 | |
# この際、 | |
# node = tagger.parseToNode(string.encode("utf-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
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
from svm import * | |
from svmutil import * | |
# For learning | |
t_label = [1,-1,1,-1] | |
t_data = [ | |
[1.0, 2.0, 3.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
library(ggplot2) # For Plot | |
library(kernlab) # For SVM | |
auth = read.table("./CodeIQ_auth.txt",header=F,sep=" ") | |
names(auth) <- c("volume","weight","truth") # 0 is Fake | |
my_coins = read.table("./CodeIQ_mycoins.txt",header=F,sep=" ") | |
names(my_coins) <- c("volume","weight") | |
g = ggplot(auth,aes(x=volume,y=weight)) + geom_point(aes(color=truth)) |
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
m = MeCab::Tagger.new "-Ochasen -u lib/wikipedia_user.dic" | |
mecab_str = m.parse(string) | |
c = CaboCha::Parser.new "-f4 -I1" | |
lines = c.parseToString(mecab_str).force_encoding("UTF-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
[ | |
{ | |
"name": "log_time", | |
"type": "INTEGER" | |
}, | |
{ | |
"name": "created_at", | |
"type": "STRING" | |
}, | |
{ |
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
[ | |
{ | |
"name": "log_time", | |
"type": "INTEGER" | |
}, | |
{ | |
"name": "created_at", | |
"type": "STRING" | |
}, | |
{ |
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 -*- | |
### Library | |
import MySQLdb | |
import pandas.io.sql as psql | |
import pandas as pd | |
import numpy as np | |
import MeCab | |
from gensim import corpora |
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
time | count | |
---|---|---|
0 | 42 | |
4 | 42 | |
8 | 42 | |
12 | 42 | |
16 | 41 | |
20 | 41 | |
24 | 41 | |
28 | 41 | |
32 | 41 |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 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
64 | |
90 | |
145 | |
152 | |
214 | |
93 | |
98 | |
66 | |
116 | |
129 |
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
member | is_smoking | |
---|---|---|
A | 1 | |
B | 0 | |
C | 0 | |
D | 1 | |
E | 0 | |
F | 0 | |
G | 0 | |
H | 0 | |
I | 0 |
OlderNewer