14
Introduction to Information Retrieval Project : from Classification to Prediction 楊立偉教授 [email protected] © Copyright 1

Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

  • Upload
    others

  • View
    14

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

Introduction to Information Retrieval

Project : from Classification to Prediction

楊立偉教授[email protected]

© Copyright

1

Page 2: Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

Copyright © Proprietary and Confidential. All rights reserved.

分析方法

常見的股市分析方法,與各種內外部變數有關

2

基本面 例如企業的營收、獲利、本益比等

技術面 例如股票價格的走勢,價格及交易量的關係等

消息面 例如重大訊息等

環境面 例如經濟景氣,匯率、利率等

Page 3: Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

Copyright © Proprietary and Confidential. All rights reserved. 3

基本面

包括企業的登記

事項、營業狀況、

財務報表等。

以台積電為例

(取自Yahoo!股市)

Page 4: Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

Copyright © Proprietary and Confidential. All rights reserved.

資料特性

包括了結構性及非結構性的資料,例如

資料特性

公開發行公司的財務報表及營業報告

外部資料,例如經濟指標,研究報告、報導或評論

交易資料,例如交易價格(開盤、收盤)、交易量(買方、賣方)

帶有時間

可能與過往相關

連續性

Page 5: Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

Copyright © Proprietary and Confidential. All rights reserved.

a

5

技術面 以價格及交易量的關係建立各式指標,作時間序列分析

以台積電為例 (取自XQ操盤高手)

Page 6: Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

Copyright © OpView & eLand Information. Proprietary and Confidential. All rights reserved.

社群大數據預測原理

6

內部訊息易由社群傳播:內部訊息 (inside information、

不對稱的資訊) 總會有人知曉,透過各種方式傳播。以社

群傳播最為容易,進而擴散。

群眾決定市場:當市場是由群眾決定時,了解群眾的想法,

即可預測市場。

消息不論真確度均值得參考:無論是流言或假消息,皆會

影響大眾及市場。

Page 7: Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

Copyright © Proprietary and Confidential. All rights reserved.

知名案例

7

Source: http://uk.businessinsider.com/ecb-twitter-bullishness-stock-market-moves-2015-7

Page 8: Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

Copyright © Proprietary and Confidential. All rights reserved.

"Twitter mood predicts the stock market"

We find an accuracy of 86.7% in predicting the daily up and

down changes in the closing values of the DJIA and a

reduction of the Mean Average Percentage Error (MAPE) by

more than 6%. Bollen, et. al. 2010

應用範圍

在資訊不對稱的群眾市場,以人工智慧語意技術,分析消息情報

後所做的預測

在台灣,針對不同標的、不同期間、預測出手正確率可到多少?

8

Page 9: Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

Copyright © Proprietary and Confidential. All rights reserved. 9

有些新聞或討論文章出現後,若干日後股價會漲→收集一批成為【看漲文章】範本

有些新聞或討論文章出現後,若干日後股價會跌→收集一批成為【看跌文章】範本

Source: 楊立偉,〈大數據與商業分析〉課程,台灣大學

以短期、特定個股為例

Page 10: Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

Copyright © Proprietary and Confidential. All rights reserved. 10

今天新聞和討論文章又這麼多。每篇都用相似分析看看,是比較像【看漲文章】、還是【看跌文章】。每篇文章都有幾個選項(漲或跌、或持平),最後機器一起投票,猜猜數天後股價會漲或跌?

Source: 楊立偉,〈大數據與商業分析〉課程,台灣大學

機器學習法為例

Page 11: Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

Introduction to Information Retrieval

Requirement (1)

• 需求一:分別取出看漲及看跌的關鍵字列表

• 參考做法

1. 用種子關鍵字,例如下跌、衰退等,挑選一批文章後,找出具鑑別力的關鍵字列表。

2. 或用指數或股價漲跌,例如第D+n天與第D天相比,指數或價格下跌超過特定幅度σ,則視第D天的文章合為一批為看跌文件集,從中找出具鑑別力的關鍵字列表;看漲文件集亦然。

– n及σ為實驗參數;可自行設計或應用其他技巧。

11

Page 12: Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

Introduction to Information Retrieval

Requirement (2)

• 需求二:預測指數或股價漲跌,並回測準確率

• 參考做法

– 可針對指數、或是經過篩選的若干個股,由需求一的詞彙集建立向量空間模型,再依每日文章相似程度進行投票或分類,以預測未來漲跌

– 個股建議挑選股價活潑、討論量大者

– 進行模擬回測:模擬D日出現的新文件,預測D+n的漲跌方向。可以預測漲、跌、或不出手 (難以判別)。請計算出手率,以及出手次數中的正確率

– 其它未規範之處可自行設計,進行多次實驗

– 亦可結合結構性資料 (基本面、技術面、環境面)

12

Page 13: Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

Introduction to Information Retrieval

Dataset

• 語料

– 2016/2017 (前11個月+股價)

• 7zip解壓縮, Microsoft Access格式

• 內含鉅亨網, Yahoo奇摩理財, Yahoo股市, 聯合財經網 (全)、

mobile01 > 投資與理財, PTT Stock, 168理財網等

– 挑選股票相關頻道,去掉日常例行發文(如天氣、價格)

13

Page 14: Project : from Classification to Predictionhomepage.ntu.edu.tw/~wyang/bda2018/slides/bda2018_mid_proj.pdf · Introduction to Information Retrieval Dataset •語料 –2016/2017 (前11個月+股價)

Introduction to Information Retrieval

Deliverables

• 分組展示

– 不限程式語言與演算法

– 3周後上台展示

• 先以投影片說明,之後進行實機demo,再進行code review

• 最後將投影片、系統擷圖、程式碼打包壓縮zip繳交 (檔案過大

者請繳交連結)

14