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
| 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 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
| 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 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 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 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 python | |
| #-*- coding:utf-8 -*- | |
| import MeCab | |
| m = MeCab.Tagger("-Ochasen") | |
| string = u"それサバンナでも同じ事言えんの?" | |
| # MeCabでUnicode文字列を扱う場合は、一度エンコードする必要がある。 | |
| # この際、 | |
| # node = tagger.parseToNode(string.encode("utf-8")) |
NewerOlder