Skip to content

Instantly share code, notes, and snippets.

View HirofumiYashima's full-sized avatar

HirofumiYashima HirofumiYashima

  • (a data science consulting venture company)
  • Tokyo, Japan
View GitHub Profile
@HirofumiYashima
HirofumiYashima / Python
Last active August 29, 2017 07:38
【 Python 時系列解析 】Yahoo Finance から FTSEロンドン株価データ を 取得して、経済時系列解析 の 作業手順 を通しで行ってみる 〜 データの定常性検定 から(G)ARCHモデル推定 まで ref: http://qiita.com/HirofumiYashima/items/a5d92607bedf3d58944d
lb_garch = stattools.q_stat(garch_resid_acf, len(close_diff_1))
print(lb_garch)
print(lb_garch[1])
@HirofumiYashima
HirofumiYashima / Python
Created March 29, 2016 04:45
【Python で機械学習】ランダム・フォレスト•モデル 情報掲載 参考ウェブサイトまとめ ref: http://qiita.com/HirofumiYashima/items/b296a81ba918fac2353e
from sklearn.ensemble import RandomForestClassifier
trainingdata = [[1, 1], [2, 2], [-1, -1], [-2, -2]]
traininglabel = [1, 1, -1, -1]
testdata = [[3, 3], [-3, -3]]
model = RandomForestClassifier()
model.fit(trainingdata, traininglabel)
output = model.predict(testdata)
@HirofumiYashima
HirofumiYashima / SWI-Prolog対話的インタプリタ環境
Last active November 24, 2017 07:49
IBM Watson と SoftBank Pepperくん の頭脳に採用された Prolog言語 入門(2)〜 外部ファイル に 記述した「事実」&「規則」の セット を SWI_Prolog インタプリタ に ロードして、対話的 に 質問 を 問いかけてみた ref: https://qiita.com/HirofumiYashima/items/15165b0fbb54f053ad0a
# trial.swiファイル を ロード
['trial.swi']
# 質問問いかけ 始め
female(alice).
make(ben). % 打ち間違えて、未定義の述語 make を 入力
male(ben).
likes(alice, ben).
likes(ben, alice).
owns(ben, violin) % 未定義述語 owns を 入力 (ピリオド打ち忘れ)
@HirofumiYashima
HirofumiYashima / SWI-Prolog
Last active November 24, 2017 07:50
IBM Watson と SoftBank Pepperくん の頭脳に採用された Prolog言語 入門(1)〜 Mac OS X Capitan に SWI-Prolog インストール して、対話型インタプリタで使ってみる ref: https://qiita.com/HirofumiYashima/items/82fc4616f1998ecddb5b
?- [user].
|: male(ben).
|: having_dinner(ben).
|: true.
?- having_dinner(X).
X = ben.
?- having_dinner(ben).
@HirofumiYashima
HirofumiYashima / 2次元配列
Last active January 7, 2016 12:30
【 Scala 】データ取得したいカラム を 複数指定して、 SQL の cross join 的に、指定したカラム の データの全組み合わせ集合 を返す Scala コード を使ってみた(用途:ダミーデータ生成 etc.) ref: http://qiita.com/HirofumiYashima/items/a5ec4afc10918db9f648
[ ["あ", "い" , "う" , "え" , "お"] , ["A", "B" , "C" , "D" , "E"] , ["ア", "イ" , "ウ" , "エ" , "オ"]]
@HirofumiYashima
HirofumiYashima / 1文書 につき 1つ、以下の数値ベクトル(リスト型オブジェクト)を生成
Last active January 12, 2016 09:07
【 自然言語処理 】対象文書ファイル群の特徴を捉える可能性が高いトークン集合(候補)を、全出現単語集合から自動抽出する方法 ref: http://qiita.com/HirofumiYashima/items/61890a067026db99ff17
[単語1のtf*id値 , 単語2のtf*id値 , 単語3のtf*id値 , 単語4のtf*id値 , 単語5のtf*id値 , ... ]
@HirofumiYashima
HirofumiYashima / file0.txt
Last active January 11, 2017 12:46
【 キャリア × 関数型言語 】金融業界 における 関数型言語 導入実績 ~ Haskell, F#, Scala も採用されているが、LexiFi社 & Jane Street社 の成功 が 背景にあり、 OCaml の 存在感 が 強い ref: http://qiita.com/HirofumiYashima/items/98d35b40dde12bbb5d6d
OCaml for the Masses - ACM Queue
@HirofumiYashima
HirofumiYashima / file0.txt
Last active October 3, 2015 08:40
【 関数型プログラミング 】 無名関数(lambda)・ラムダ式・ラムダ計算の 呼び名 と 記法 は、なぜ lambda(ラムダ) なのか? ~ 数理論理学の大著『プリンキピア・マテマティカ』中で 使われた カレット記号「^」 を、アロンゾ・チャーチ が ギリシャ文字「ラムダ」の大文字(Λ)に置き換えたのが由来と判明。 ref: http://qiita.com/HirofumiYashima/items/836087b649e8b10ef3ac
(山下 伸夫)
@HirofumiYashima
HirofumiYashima / file0.txt
Last active September 23, 2015 12:06
W3C が「感情のマークアップ言語」、EmotionML を導入 ~ <emotionml> タグ & <emotion>タグ を使って、ウェブページに「感情」種別と「感情の強弱 度合い」が記述可能になった ref: http://qiita.com/HirofumiYashima/items/682b9ce686c024af1739
<emotionml xmlns="http://www.w3.org/2009/10/emotionml"
xmlns:meta="http://www.example.com/metadata"
category-set="http://www.w3.org/TR/emotion-voc/xml#everyday-categories">
<emotion>
<category name="Anger" values="0.97"/>
'I've got angry, Umhhhhhh !!!!!'
</emotion>
</emotionml>
@HirofumiYashima
HirofumiYashima / JSON
Last active November 25, 2017 23:53
Google はどうやって、ソーシャルグラフ データベースを構築しているのか? 〜 FOAF "Friend of a Friend" タグ と XFN "Xhtml Friends Network" タグ に クロール収集 をかけている ref: https://qiita.com/HirofumiYashima/items/22c0d65253e68ad592a2
{
"canonical_mapping": {
"http://twitter.com/zaki": "http://twitter.com/zaki"
},
"nodes": {
"http://twitter.com/zaki": {
"attributes": {
"url": "http://twitter.com/zaki",
"profile": "http://twitter.com/zaki",
"rss": "http://twitter.com/statuses/user_timeline/zaki.rss",