2018年度 技術講座 2360 機械学習 - 九州大 …...>i think windows could manage these...

69
Copyright©2019 NTT corp. All Rights Reserved. 九州ADS育成コンソーシアム 1Dayデータサイエンスセミナー 多次元/時空間データ分析 2019年3月9日 13:30~15:00 @TKP博多駅前シティセンター 澤田 , 納谷 太 (NTTコミュニケーション科学基礎研究所)

Upload: others

Post on 08-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

Copyright©2019 NTT corp. All Rights Reserved.

九州ADS育成コンソーシアム

1Dayデータサイエンスセミナー

多次元/時空間データ分析

2019年3月9日 13:30~15:00@TKP博多駅前シティセンター

澤田 宏 , 納谷 太(NTTコミュニケーション科学基礎研究所)

Page 2: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

1Copyright©2019 NTT corp. All Rights Reserved.

• 2名で担当します

• 澤田担当分

イントロダクション

非負値行列因子分解(NMF)

多次元データ分析

• 納谷担当分

時空間データ分析

本講演(90分)の全体像

60分くらい

30分くらい

Page 3: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

2Copyright©2019 NTT corp. All Rights Reserved.

様々なデータ活用方法

機械学習

データ

検索認識,検知

一部分を見る

教師あり

集計

全体を見る

何か隠れているかもしれない 分析

可視化

成分への分解クラスタ発見異常値・外れ値検出

予測,推薦

教師なし

Page 4: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

3Copyright©2019 NTT corp. All Rights Reserved.

機械学習

教師あり学習 教師なし学習 強化学習

入力データ

機械データ機械

教師ラベル(正解)

入力データ

データ

行動

報酬

機械 環境

前のスライド

本講演

Page 5: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

4Copyright©2019 NTT corp. All Rights Reserved.

本講演で紹介する実例

ヴォーカル分離 文書分類 口コミ(Yelp)分析

訪日外国人周遊パターン

©OpenStreetMap ©CARTO

都市交通流分析 集団の最適誘導

Page 6: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

5Copyright©2019 NTT corp. All Rights Reserved.

イントロダクション

非負値行列因子分解(NMF)

多次元データ分析

時空間データ分析

アウトライン

Page 7: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

6Copyright©2019 NTT corp. All Rights Reserved.

教材として非常に望ましいNMF

NMF: Non-negative Matrix Factorization

非負値行列因子分解

音響信号

画像 テキスト文書

生体信号

遺伝子

数学 最適化手法

1. 多様な応用範囲2. 数学や最適化を学べる

Page 8: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

7Copyright©2019 NTT corp. All Rights Reserved.

データの行列表現

•購買履歴

•文書集合

» Bag-of-words

•音

»スペクトログラム (spectrogram)

多種多様なデータが行列形式で表現できる

商品

ユーザ

Page 9: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

8Copyright©2019 NTT corp. All Rights Reserved.

Bag-of-words 表現

Page 10: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

9Copyright©2019 NTT corp. All Rights Reserved.

文書集合の行列表現

•1つの文書をBag-of-words表現

単語

教師データ学習モデル円産業アフリカ天然資源:

文書

3

3

2

1

0

0

0

0

0

0 1 0 0 0 0 0 0 0 1 0

0 0 1 0 0 0 0 0 0 0 1

0 1 0 0 0 0 0 0 0 1 0

0 0 1 0 0 0 0 0 0 0 0

0 0 2 1 0 1 0 0 0 0 0 ‥0 2 0 3 3 2 0 0 1 0 0

1 0 0 0 0 0 1 2 1 1 2

2 0 0 0 2 0 0 1 1 0 0

1 0 0 1 1 0 1 1 2 0 0

•文書を横方向に並べて行列表現

Page 11: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

10Copyright©2019 NTT corp. All Rights Reserved.

音の時間周波数表現

時間

周波数

振幅値

これを行列表現とみなす

スペクトログラム時間周波数複素数

波形時間振幅値

Page 12: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

11Copyright©2019 NTT corp. All Rights Reserved.

NMFとその発展

1999年

から図を引用

負の値を使わないデータ分析

科学誌 Nature

2003年~

音の分解

文書の分類

ユーザによる商品購買

様々なデータへの適用

2013年~複合データ

ビッグデータ

購買ログ

天気DBイベント情報

鉄道運行情報

ITS(交通)DB

地理情報DB

位置情報

属性情報

Page 13: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

12Copyright©2019 NTT corp. All Rights Reserved.

NMFの定式化

I

J

I

K

K

J

2 3

1 1

1 0

1 2

1 2 2 0 3

1 0 2 1 2=

5 4 10 3 122 2 4 1 51 2 2 0 33 2 6 2 7

I×J行列をI×K行列とK×J行列の積に分解

要素はすべて非負(0か正の値)

Page 14: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

13Copyright©2019 NTT corp. All Rights Reserved.

練習問題(1)

• 次の行列に対し,基底の数 K=2 でNMFを適用

1 1 2 3 1

0 1 0 1 1

2 0 4 4 0

3 0 6 6 0

? ?

? ?

? ?

? ?

? ? ? ? ?

? ? ? ? ?

ヒント: 繰り返し出てきている列パターンに注目

1 1

0 1

2 0

3 0

1 0 2 2 0

0 1 0 1 1

Page 15: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

14Copyright©2019 NTT corp. All Rights Reserved.

NMFを音響信号に適用

NMF, K=5

頻出パターンがうまく抽出された

=周波数

時間

NMF基底3つの音

Page 16: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

15Copyright©2019 NTT corp. All Rights Reserved.

NMF結果の表示

周波数

時間

基底

Page 17: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

16Copyright©2019 NTT corp. All Rights Reserved.

NMFの拡張: Convolutive-NMF

• 時間方向の連続性を考慮して,拡張したもの

• 音のパターンが1フレームを超える場合に有効– 1フレーム = 64 ms

1 3 0 1 0 2 0

0 3 3 0 0 2 2

2 1 3 2 1 0 2

3 2 0 3 2 0 0

1 0 0 1 0 0 0

0 3 0 0 0 2 0=

1 0

0 0

2 1

3 2

1 0

1 1

0 1

0 0

時間

Page 18: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

17Copyright©2019 NTT corp. All Rights Reserved.

NMF(上)とConvolutive-NMF(下)の比較

音の基底

Page 19: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

18Copyright©2019 NTT corp. All Rights Reserved.

NMFによるヴォーカル分離

前奏10秒で学習した基底

2番目の基底

20秒の音楽の前奏10秒です.

Page 20: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

19Copyright©2019 NTT corp. All Rights Reserved.

NMFによるヴォーカル分離

前奏の基底 ヴォーカルの基底

•NMFの学習アルゴリズムの際

»前奏の基底 T は更新しない

»ヴォーカルの T と V ,および前奏の V を更新する

今度は,全体20秒に対してNMFを適用

Page 21: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

20Copyright©2019 NTT corp. All Rights Reserved.

NMFで学習した30個の基底

前奏の基底 ヴォーカルの基底

Page 22: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

21Copyright©2019 NTT corp. All Rights Reserved.

ヴォーカル分離の結果

Page 23: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

22Copyright©2019 NTT corp. All Rights Reserved.

NMFを用いた文書解析

• 文章をBag-of-words表現

• 文書集合に対して行列表現

• NMFにより頻出単語パターンを抽出

単語

サッカーボールゴール経済円産業アフリカ天然資源:

文書0 1 0 0 0 0 0 0 0 1 2

0 2 1 0 0 0 0 0 0 0 1

1 1 0 0 0 1 0 0 0 1 0

0 0 1 0 2 2 0 0 0 0 0

0 0 0 1 0 1 0 0 0 0 0 ‥0 0 0 0 3 2 0 0 1 0 0

0 0 0 0 0 0 1 2 1 1 2

0 0 0 0 0 0 0 1 1 0 0

0 0 0 0 0 0 1 1 2 0 0

Page 24: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

23Copyright©2019 NTT corp. All Rights Reserved.

20 Newsgroups data set の解析

From: [email protected] (Lamont Downs)

Subject: Re: Windows gripe...

> There's one thing about Windows that really frosts me.

>I have 20MB of RAM installed in my system. I use a 5MB (2.5MB

>under Windows) disk-cache, and a 4MB permanent swap file.

>

> While I can never fill the memory up, I still have problems

>sometimes because I run out of GDI resources. What gives?

>I think Windows could manage these resources a little better.

>

Are you using Windows 3.0 or 3.1? If you're still on 3.0, 3.1 devotes about

twice as much memory to these and runs out much less frequently. If 3.1,

you might use one of the resource monitors (such as the one that comes with

the Windows 3.1 Resource Kit or one of the many shareware ones available)

to see which programs are hogging the resources (every icon, internal

graphics brush, etc. in every program running uses a certain amount of

this limited memory area. Also, some don't give it back when they're

finished).

Lamont Downs

[email protected]

20個のニュースグループ

合計18828個の投稿

(右は一例)

単語の種類は52647個

Page 25: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

24Copyright©2019 NTT corp. All Rights Reserved.

NMFによる解析結果(T)

I = 52647

J = 18828

I

K = 20

K

J

単語windows

server

tar

単語分布

Page 26: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

25

各基底 T の上位10個の単語

1. db, cx, ah, mc, mv, chz, lk, sc, hz, bh

2. people, fire, fbi, gun, koresh, children, time, batf, waco, started

3. game, team, hockey, games, play, season, nhl, la, win, year

4. windows, file, graphics, server, sun, motif, ftp, version, window, mail

5. earth, space, entry, mission, output, orbit, program, file, solar, spacecraft

6. power, car, light, water, good, oil, high, time, ground, engine

7. mail, key, list, information, send, email, internet, software, computer, message

8. drive, dos, card, windows, scsi, system, pc, disk, mac, problem

9. clipper, chip, key, gun, encryption, law, government, people, police, keys

10. image, file, files, program, data, color, bit, images, jpeg, format

11. car, bike, good, time, back, dod, ride, day, left, make

12. government, president, people, clinton, states, state, public, american, money, bill

13. god, jesus, bible, christian, church, christ, people, christians, faith, life

14. people, israel, jews, israeli, jewish, religion, war, arab, peace, religious

15. people, evidence, science, question, make, things, good, morality, moral, true

16. year, good, time, game, team, baseball, players, hit, years, runs

17. space, nasa, launch, cost, gov, henry, dc, station, shuttle, year

18. max, window, pl, giz, wm, bhj, widget, bxn, gk, sl

19. armenian, turkish, armenians, people, armenia, turkey, turks, soviet, genocide, russian

20. medical, health, disease, study, cancer, patients, doctor, treatment, medicine, research

a. comp.graphics

b. comp.os.ms-windows.misc

c. comp.sys.ibm.pc.hardware

d. comp.sys.mac.hardware

e. comp.windows.x

f. rec.autos

g. rec.motorcycles

h. rec.sport.baseball

i. rec.sport.hockey

j. sci.crypt

k. sci.electronics

l. sci.med

m. sci.space

n. misc.forsale

o. talk.politics.misc

p. talk.politics.guns

q. talk.politics.mideast

r. talk.religion.misc

s. alt.atheism

t. soc.religion.christian

Page 27: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

26Copyright©2018 NTT corp. All Rights Reserved.

練習問題(2)

前ページの結果において,青線を引いたものに対応する4つの基底が,どのnewsgroupに対応するか

3. game, team, hockey, games, play, season, nhl, la, win, year

5. earth, space, entry, mission, output, orbit, program, file, solar, spacecraft

10. image, file, files, program, data, color, bit, images, jpeg, format

13. god, jesus, bible, christian, church, christ, people, christians, faith, life

i. rec.sport.hockey

t. soc.religion.christian

m. sci.space

a. comp.graphics

Page 28: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

27

NMFによる解析結果(V)

I = 52647

J = 18828

I

K = 20

K

J

単語

years, book, books, code(3), files, hard, pascal, ad, knew,

wanted, graphics(4), software, library(5), points, ftp, fast,

recommend, mac(5), line(2), comp, program(2), call, gl, draw,

routines, hidden, removal, find, handle, source, time, binaries,

sites, access, easy, plot, shading, apple(2), included, grafsys,

rom, recommendations, functions(2), output, sys, offer, demo,

choice, extra, documentation, basic, low, level, happy, future,

plans, wrote, give, talking, suggest, quickdraw(2), built(2),

translation, avoid, including, header, exist, figure,

implementing, stuff, things, weeks, limited, tax, wheel,

individual, expect, folks, easier, sense, ago, objects, explain,

lot(3), assume, pretty, mentioned, places, excellent, clarify,

enjoy, unsupported, submit, distributed, nauseum, rotation,

undocumented, reinventing, witht, libray, programmatically,

brent, nicer

Page 29: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

28

NMFによる解析結果(V)

I = 52647

J = 18828

I

K = 20

K

J

単語

ランダムに100個選んだ V の列

多くの文書が1個または数個の基底で表現されている

Page 30: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

29Copyright©2018 NTT corp. All Rights Reserved.

文書解析のまとめ

教師無し機械学習

文書そのもののみ

どのNewsgroupに投稿されたかは使わず

NMFの結果

K=20個の単語分布(トピック)を構成

各文書は,1個か数個のトピックを持つ

大量の文書を自動的にクラスタリングできた

似たものを集める

Page 31: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

30Copyright©2019 NTT corp. All Rights Reserved.

基底の数と近似誤差

K=1 K=5 K=15

基底の数

近似誤差

Page 32: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

31

NMFにおける距離尺度

I

J

I

K

K

J

• Euclid距離の二乗

• 一般化 KL divergence

• Itakura-Saito (IS) divergence

Page 33: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

32Copyright©2019 NTT corp. All Rights Reserved.

NMF アルゴリズム

Euclid距離の二乗

一般化 KL divergence

Itakura-Saito (IS) divergence

密行列スパース行列

Page 34: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

33Copyright©2019 NTT corp. All Rights Reserved.

NMFアルゴリズム 実行の様子

• 20 Newsgroups Bag-of-words に対して

– 約5万×約2万のスパース行列

• 繰り返し回数50回,実行時間52秒(Core

i7 8700K 3.7GHz)

• 音楽ファイル(3分14秒)に対して

– 2049×4181の密行列

• 繰り返し回数50回,実行時間20秒(Core

i7 8700K 3.7GHz)

• PytorchでGPUを使うと: 繰り返し回数50

回,実行時間3秒(GTX 1080 Ti)

繰り返し回数

誤差

繰り返し回数

誤差

Page 35: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

34Copyright©2019 NTT corp. All Rights Reserved.

NMFのまとめ

NMFは頻出パターンを自動的に抽出音の分析: 自動採譜,音源分離

文書群の分析: トピック分析,自動分類

NMFアルゴリズム

シンプルな更新式

NMFの解説 非負値行列因子分解 NMF の基礎とデータ/信号

解析への応用,信学誌 95.9 (2012): 829-833.

Page 36: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

35Copyright©2019 NTT corp. All Rights Reserved.

イントロダクション

非負値行列因子分解(NMF)

多次元データ分析

時空間データ分析

アウトライン

Page 37: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

36Copyright©2019 NTT corp. All Rights Reserved.

データ次第で次元は増やせる

年月日 時間 場所 ユーザ 年代性別 商品

2013年2月5日 07:31 コンビニ Aさん 30代男性 コーヒー

2013年2月5日 18:03 スーパー Bさん 40代女性 牛乳

2013年2月8日 17:51 スーパー Cさん 20代男性 ベーコン

2013年2月11日 12:18 ドラッグストア Aさん 30代男性 シャンプー

: : : : : :

誰が何を買ったかの行列

どこで誰が何を買ったかのテンソル

商品

ユーザ

商品ユーザ

場所

Page 38: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

37Copyright©2019 NTT corp. All Rights Reserved.

行列分解とテンソル分解

商品

ユーザ

商品ユーザ

場所

⊗≈

≈⊗

アルゴリズム(Multiplicative

update rules等)が同様に導出できる

NMF: Non-negative Matrix Factorization

NTF: Non-negative Tensor Factorization

Page 39: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

38Copyright©2019 NTT corp. All Rights Reserved.

次元を増やす弊害

次元を増やすとスパース性の問題が顕在化

10.57 % 0.74 % 0.045 %

2 3 4

非ゼロ確率

次元

満足のいく分析結果が得られにくい

次元

組合せの数 1回以上の購買

非ゼロ確率(スパース度)

2 ユーザ×商品 = 4805×296= 1,422,280 通り

150,316個 10.57 %(89.43 %)

3 場所×ユーザ×商品= 24,178,760通り

179,324個 0.74 %(99.26 %)

4 商品×ユーザ×場所×時間= 580,290,240通り

260,326個 0.045 %(99.955 %)

Page 40: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

39Copyright©2019 NTT corp. All Rights Reserved.

多次元(複合)データ分析技術

元データ 5次元で集計

スパース性が高すぎて良い分析が出来ない!

共有したまま分析を行うため,集計結果は同一となる

次元を共有

3次元で集計×2,うち1次元共通

スパース性の問題を緩和し,意味のある分析を行う!

ユーザ

ユーザ

時間

品目場所

年代性別

分解,集計

Page 41: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

40Copyright©2019 NTT corp. All Rights Reserved.

多次元複合データ分析技術

複数のデータ源

共通する軸で紐付ける

NMTF: Non-negative Multiple Tensor Factorization

Page 42: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

41Copyright©2019 NTT corp. All Rights Reserved.

Yelp Datasetを用いた実験

Yelp Dataset

Yelpはアメリカのレビューサイト

学術的用途に向けて公開

多様な属性: ユーザ,店舗,カテゴリ,位置,単語,曜日,時間

下記3テンソルをNMTFで分析

ユーザ×店舗×曜日 = 1228 × 1860 × 7

ユーザ× カテゴリ×単語 = 1228 × 235 × 92052

位置×店舗×時間 = 63 × 1860 × 186

次元を共有することで、関連させながら分析し、全体で意味のある分析結果を導出

Page 43: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

42Copyright©2019 NTT corp. All Rights Reserved.

レジャー施設クラスタ

ICDM2013

Amusement and parks area

park

hike

zoo

Page 44: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

43Copyright©2019 NTT corp. All Rights Reserved.

食事に関する2つのクラスタ

日本食レストランクラスタ平日午後の食事クラスタ

Page 45: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

44Copyright©2019 NTT corp. All Rights Reserved.

イントロダクション

非負値行列因子分解(NMF)

多次元データ分析

時空間データ分析

アウトライン

Page 46: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

45Copyright©2019 NTT corp. All Rights Reserved.

時刻・日付・場所の情報を持つテンソル因子分解

行列

場所

時刻

場所・時刻を共通化して結合

テンソル

三次テンソル

場所

時刻

行列データからテンソルデータへ拡張

テンソル因子分解により時空間的な潜在パターンを自動抽出可能

Page 47: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

46Copyright©2019 NTT corp. All Rights Reserved.

グラフ構造正則化付き非負値テンソル補完

データの時空間的な連続性をグラフ構造正則化として与え因子分解欠損値が多く含まれるデータからも安定的にパターンを抽出

Koh Takeuchi, Naonori Ueda, “Graph Regularized Non-negative Tensor Completion for Spatio-temporal Data Analysis,” Proc. of SmartCities’16, pp.5:1-5:6, 2016

日付

テンソル

時刻

位置特徴的なパターン1

特徴的なパターン2 …

どこが混雑するか

何曜日に起きるか

何時に現れやすいか

元のデータを再現できるよう、データに隠された特徴的なパターンを抽出→ データの欠損を復元可能!

Page 48: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

47Copyright©2019 NTT corp. All Rights Reserved.

時空間の連続性を考慮したテンソル分解

曜日に関する連続性時刻に関する連続性場所に関する連続性

データの大部分を再現できるようパターンを最適化する

時空間の連続性を正則化として導入

Koh Takeuchi, Naonori Ueda, “Graph Regularized Non-negative Tensor Completion for Spatio-temporal Data Analysis,” Proc. of SmartCities’16, pp.5:1-5:6, 2016

Page 49: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

48Copyright©2019 NTT corp. All Rights Reserved.

車交通流データの解析例

• ・市内の道路を通過した車両数の計測データ

• ・車の交通量における特徴的なパターンを抽出

Mon Tue Wed Thu Fri Sat San0

1000

2000

3000

Week 1

Mon Tue Wed Thu Fri Sat San0

1000

2000

3000

4000

Week 2

システム故障によるデータ欠損が頻発し、全体の約30%が欠損

道路毎の車両量の総和 時間毎の車両量の総和

©OpenStreetMap ©CARTO

Page 50: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

49Copyright©2019 NTT corp. All Rights Reserved.

スマートシティデータへの適用例

CityPulse データセットhttp://iot.ee.surrey.ac.uk:8080/datasets.html

デンマーク・オーフス市で計測収集された公開データセット 交通流: 441箇所、30分毎、0-24時

駐車場台数: 8箇所

気象データ: 温度、気圧、湿度、風速の4種

期間:2014.8.1~9.31(61日間)交通流ヒートマップ例

http://livingqlikview.com/qlik-sense-the-internet-of-things-iot-example-app/

Page 51: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

50Copyright©2019 NTT corp. All Rights Reserved.

特徴的なパターンとリズムを自動抽出

•平日午前

都心方向への移動平日午後

都心外への移動休日正午

都市各部の混雑

08.Aug15.Aug22.Aug29.Aug05.Sep12.Sep19.Sep26.Sep

00:00 06:00 12:00 18:00

08.Aug15.Aug22.Aug29.Aug05.Sep12.Sep19.Sep26.Sep

00:00 06:00 12:00 18:00

08.Aug15.Aug22.Aug29.Aug05.Sep12.Sep19.Sep26.Sep

00:00 06:00 12:00 18:00

©OpenStreetMap ©CARTO ©OpenStreetMap ©CARTO ©OpenStreetMap ©CARTO

Page 52: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

51Copyright©2019 NTT corp. All Rights Reserved.

従来法との比較

提案法

○矢印が滑らかにつながり交通量の流れが理解できる

○交通流の曜日ごとのリズムが把握できる

08.Aug 15.Aug 22.Aug 29.Aug 05.Sep 12.Sep 19.Sep 26.Sep

Time [day]

Time [Hour]

00:00 06:00 12:00 18:00

平日午前の都心への移動

従来法

× 連続した流れが取れていない

× 矢印の方向がばらつく

Time [Hour]

00:00 06:00 12:00 18:00

08.Aug 15.Aug 22.Aug 29.Aug 05.Sep 12.Sep 19.Sep 26.Sep

Time [day]

× 曜日ごとの規則性が安定しない

○矢印が滑らかにつながり交通流が理解できる

©OpenStreetMap ©CARTO ©OpenStreetMap ©CARTO

従来法に比べ、データに欠損値が多く含まれる場合においても時空間的に一貫した潜在パターンを自動抽出可能

(テンソル分解のみ)

Page 53: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

Copyright©2017 日本電信電話株式会社

World Urbanization

都市化

Page 54: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

53Copyright©2019 NTT corp. All Rights Reserved.

都市化比率

アメリカ

日本中国(香港)

100%

1950年:30%2014年:54%2050年:66%

Page 55: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

54Copyright©2019 NTT corp. All Rights Reserved.

都市と地方での人口推移

都市の人口

地方の人口

2015

全世界で都市化は加速の一途をたどる!?

60億人

2050

Page 56: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

55Copyright©2019 NTT corp. All Rights Reserved.

オンライン時空間予測・制御技術

1.集団最適性個人ではなく、集団として最適な誘導

2.リアルタイム性現時点での状況(観測)に応じたリアルタイムな誘導

3.先行性渋滞が生じる前に、予測に基づいた先行的な誘導

ナビゲーションが満たすべき要件

Page 57: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

56Copyright©2019 NTT corp. All Rights Reserved.

①現在までの人流・混雑度観測

④誘導シナリオ・シミュレーション

②近未来予測

③誘導ポイント特定・シナリオ構築

⑤最良シナリオで集団全体を誘導

⑥次の観測へ複数のシナリオから集団全体にとって最良な誘導方法を導き、プロアクティブな人流誘導により、会場および周辺での混雑を回避

誘導シナリオA

誘導シナリオB

誘導シナリオC

時空間予測に基づく先行的誘導

Page 58: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

57Copyright©2019 NTT corp. All Rights Reserved.

時空間予測技術に求められる要件

リアルタイム性

直近の過去データのみから直近の未来を予測過去データが存在しない場合にも適用できること

汎用性

既存手法では適用困難な非定常な時空間データに対応できること

Page 59: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

58Copyright©2019 NTT corp. All Rights Reserved.

空間内挿法:クリギンング(Kriging)

Danie Gerhardus Krige (1919-2013)

南アフリカの鉱山学者地球統計学(geostatistics)の創始者

“まわりを見て自身を予測”

43

23

13 25

11

38

19

3534

11

46

37

27

17

?

地球統計学の中心的手法

Page 60: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

59Copyright©2019 NTT corp. All Rights Reserved.

クリギング予測

予測値 = 観測値の線形和

V0= w

1V

1+ w

2V

2+ + w

nV

n

未知パラメータ W は期待予測誤差最小化により求める

観測値間の共分散+真値と予測値の共分散

誤差の期待値

Page 61: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

60Copyright©2019 NTT corp. All Rights Reserved.

弱定常性

1.期待値,分散一定

2.共分散は時空間的な距離のみに依存

t +1

t

t -1

t - 2

時間的相関関係

現在

未来

過去

空間的相関関係

Page 62: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

61Copyright©2019 NTT corp. All Rights Reserved.

Kriging に基づく手法の特長と課題

空間的な内挿法としては有効将来予測(時間的外挿)には限界・時空間データの弱定常性を仮定- 統計量の平均・分散が一定,かつ,空間的相関,時間的相関が特定の場所,時刻に依らず一定

→人口の急激な変化には追従できない

非定常な時空間データでも,任意の地点・時刻での時空間変数を高精度で予測する技術が必要

Page 63: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

62Copyright©2019 NTT corp. All Rights Reserved.

時間

未来

処理の流れ

カーネルパラメータの時空間データから将来のカーネルパラメータを予測

過去

①観測 ②空間内挿 ③カーネル回帰 ④予測

カーネル回帰アプローチ(提案法)

上田: 時空間予測技術に基づく先行的集団最良誘導,応用統計学, Vol.45, No.3, pp.89-104, 2016

Page 64: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

63Copyright©2019 NTT corp. All Rights Reserved.

予測に用いる学習データ

時刻

t0-τ+1τ

t0

t0+τ’τ’

予測対象時刻

τ τ’

近過去の観測データを学習データとして用いる

・・・

t0 –τ’’

τ τ’

現在時刻

近過去データ(スライディングウィンドウ)の時空間データから非定常なパターンも学習可能

Page 65: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

64Copyright©2019 NTT corp. All Rights Reserved.

実データによる評価

64

・会場エリア:108m x 360m・人口データ:24か所のWiFi APでの計測データ

イベント会場でのメッシュ人口のヒートマップ時間推移データの例

新手法により10分以降の予測精度が従来法(ガウス過程回帰)に対し、7~10%改善し、かつ、誤差分散の改善が著しい(予測の信頼性向上)

相対絶対誤差

5分 10分 20分 30分

予測時間

提案法

従来法

40分後現在

Page 66: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

65Copyright©2019 NTT corp. All Rights Reserved.

学習型マルチエージェント・シミュレーション

• MASのパラメータを観測データに基づき自動学習• 事前の誘導・What-ifシナリオを用いた学習により,混雑リスクを回避可能な最適誘導策をオンラインで随時自動導出

学習用人流・誘導シナリオデータ

パラメータ学習

学習型シミュレーション環境

実世界観測データ 誘導策

直近混雑リスク予測

最適誘導策導出

学習型MAS

パラメータ 誘導策

シミュレーション環境

従来型MAS

• MASのパラメータや誘導策を人手で入力

• あらかじめ決められた誘導策のオフライン評価

Page 67: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

66Copyright©2019 NTT corp. All Rights Reserved.

集団最適誘導デモ

Page 68: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

67Copyright©2019 NTT corp. All Rights Reserved.

まとめ

多次元・時空間データ分析

非負値行列因子分解(NMF) ヴォーカル分離、文書分類

多次元データ分析 口コミ分析、回遊行動パターン分析

時空間データ分析

都市交通流分析、集団最適誘導

Page 69: 2018年度 技術講座 2360 機械学習 - 九州大 …...>I think Windows could manage these resources a little better. > Are you using Windows 3.0 or 3.1? If you're still on 3.0,

68Copyright©2019 NTT corp. All Rights Reserved.

ご清聴ありがとうございました