Download - Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS
![Page 1: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/1.jpg)
1© Cloudera, Inc. All rights reserved.
Ibis: すごいpandas⼤規模データ分析もらっくらく有賀康顕, Cloudera 2016/7/25 Spark + Python + Data Science祭り
![Page 2: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/2.jpg)
2© Cloudera, Inc. All rights reserved.
⾃⼰紹介• 有賀 康顕(ありが みちあき)• セールスエンジニア• お客様がCloudera製品を活⽤できるように⼀緒に議論するのが主な仕事
• メーカーの研究所で⾃然⾔語処理/機械学習の研究開発の後、クックパッドで機械学習を活⽤したプロダクト開発を⾏ってきた
email: [email protected]
![Page 3: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/3.jpg)
3© Cloudera, Inc. All rights reserved.http://chezou.hatenablog.com/entry/2016/05/05/222046
![Page 4: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/4.jpg)
4© Cloudera, Inc. All rights reserved.http://rebuild.fm/145/
![Page 5: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/5.jpg)
5© Cloudera, Inc. All rights reserved.
ClouderaとData Science• Clouderaとは?•Hadoop/Sparkを中⼼としたビッグデータ基盤を提供•社内にData Science teamを持つ• 皆さんもお世話になってるかも• 「Sparkによる実践データ解析」の著者陣は現/元Cloudera社員
https://www.oreilly.co.jp/books/9784873117508/
Director of Data ScienceSean Owen
![Page 6: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/6.jpg)
6© Cloudera, Inc. All rights reserved.
Jupyter notebook使ってますか?
![Page 7: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/7.jpg)
7© Cloudera, Inc. All rights reserved.http://techlife.cookpad.com/entry/write-once-share-anywhare
![Page 8: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/8.jpg)
8© Cloudera, Inc. All rights reserved.
Jupyter notebookを⽀えるpandas• PythonでDataFrameを扱うライブラリ• 表形式のデータをプログラマブルに処理できる• グラフ描画との連携が容易• 作者はClouderaのエンジニア
Creator of pandasWes McKinney
http://www.oreilly.co.jp/books/9784873116556/
![Page 9: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/9.jpg)
9© Cloudera, Inc. All rights reserved.
pandasの例
http://goo.gl/vTh3mJ より抜粋
SQLを使わずにフィルター、集計ができる
![Page 10: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/10.jpg)
10© Cloudera, Inc. All rights reserved.
pandasの課題• データを全部メモリに載せてしまう• ⼤規模データに対しては、SQLでデータを絞ってから処理を⾏うことになる
![Page 11: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/11.jpg)
11© Cloudera, Inc. All rights reserved.
pandasの課題• データを全部メモリに載せてしまう• ⼤規模データに対しては、SQLでデータを絞ってから処理を⾏うことになる
データの抽出の試⾏錯誤こそプログラマブルにやりたかったのに・・・
![Page 12: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/12.jpg)
12© Cloudera, Inc. All rights reserved.
pandasをカバーするIbis
![Page 13: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/13.jpg)
13© Cloudera, Inc. All rights reserved.
Ibis• PythonとBig Dataをつなぐライブラリ• ⼤規模なデータに対しても pandas like に対話的な処理を可能にする• pandasとSQLエンジンを橋渡しすることで実現• Impala / SQLite / PostgreSQL に対応• Redshift / Presto / Vertica にも今後対応予定
![Page 14: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/14.jpg)
14© Cloudera, Inc. All rights reserved.
CSV
Big Data
Before Ibis
プログラマブル
メモリに乗らないのでSQLで絞込
pandas
ImpalaRedshiftPresto
pandas
![Page 15: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/15.jpg)
15© Cloudera, Inc. All rights reserved.
After Ibis
プログラマブル
pandas Ibis Impala Big Data
CSVpandas
プログラマブル
Redshift, Prestoなどにも今後対応予定
![Page 16: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/16.jpg)
16© Cloudera, Inc. All rights reserved.
Impalaとは?• Apache Impala (incubating)•ビッグデータに特化した•インタラクティブな•分析SQL
• 15TBに対して4.4秒で処理できる!
![Page 17: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/17.jpg)
17© Cloudera, Inc. All rights reserved.
Demo• Ibis を使って Movie Lens 20M (2千万⾏)のデータを可視化• scikit-learn で好みの映画を分類するモデルを学習• バックエンドは Impala• impaladの動くサーバの21050ポート/NNの50070ポートを開ける
• 今⽇の notebook• https://github.com/chezou/ibis-demo/
![Page 18: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/18.jpg)
18© Cloudera, Inc. All rights reserved.
Demopipinstallibis-frameworkよりはじめよう
![Page 19: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/19.jpg)
19© Cloudera, Inc. All rights reserved.
PySparkとはどう違うの?• 設定が簡単•DBのコネクションの設定 + port開放だけ
• 速い• 7倍速ければ7倍試⾏錯誤ができる•速度の変化は質の変化を⽣み出す
• データ規模に応じて使い分け•⼤規模データ全体の機械学習ならSpark + MLlib•ターゲティングしたデータの機械学習にはIbis + scikit-learn• NetflixはグローバルのモデルはSpark、国・地域はRと使い分け
http://goo.gl/UA8PXzより引⽤(2016/02時点)
![Page 20: Ibis: すごい pandas ⼤規模データ分析もらっくらく #summerDS](https://reader034.vdocuments.pub/reader034/viewer/2022052302/586f9ba21a28abcc238b57b5/html5/thumbnails/20.jpg)
20© Cloudera, Inc. All rights reserved.
Further more• Redshift, Presto, Vertica, Spark SQLは今後対応予定• Redshift は array_agg(), substr() などPostgreSQLと関数名が異なる部分でうまくいかない
• https://github.com/databricks/spark-sklearn• Sparkを使って並列でパラメータチューニングできる•⼀部アルゴリズムはSpark MLlib向けにモデルを変換可能