Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
機械学習テクニカルセッション
Oracle Advanced AnalyticsによるIn-Database Machine Learning
日本オラクル株式会社
クラウド・テクノロジー事業統括
PaaS事業推進室
ソリューション・アーキテクト部
クラウドアーキテクト
小川幹雄
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
アジェンダ
• 機械学習概要
• オラクル・マシン・ラーニング
• Oracle Data Miner/デモンストレーション
• オラクルRテクノロジー全体概要
• Oracle R Enterprise
3
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
機械学習概要紹介
4
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
従来型BIからBusiness Analyticsへのシフト
5
V
A
L
U
E
D I F F I C U L T
何が起きたのか?
Descriptive Analytics
どうして起きたのか?
Diagnostic Analytics
何が起きるのか?
Predictive Analytics
どうやって起こせるのか?
Prescriptive Analytics
従来型BI Business Analytics
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
20%
予測モデル導入によるROI最大化
全体の何割にアプローチするか
100%0%
ターゲット層へヒットする割合
100%
20%
50%20%
70%
50%
ROI
顧客をランダムで選択
機械学習を使用
6
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
製品開発
Operation &
Human Capital
ファクトリーIoT
Industry 4.0
Business Analyticsの活用例
7
営業ターゲット
不正送金クロスセル
Sales &
Marketing
Finance
クレジットリスク
技術開発
タレント育成
オムニチャネル カスタマー360
メンタルケア
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
データ分析におけるPDCAサイクル (CRISP-DM)
ビジネス
理解
データ
理解
データ
準備
データ
モデリング
評価 展開
ビジネス
目的を
決定する
状況を
評価する
分析の
ゴールを
決定する
プロジェクト
計画を建てる
初期
データを
収集する
データを
記述する
データを
調べる
データの
品質を
検証する
データを
選択する
データを
整理する
データを
構築する
データを
統合する
データを
設定する
モデリング
手法を
選択する
テスト
結果を
生成する
モデルを
構築する
モデルを
評価する
結果を
評価する
プロセスを
審査する
次の
ステップを
決定する
展開を
計画する
運用を
計画する
最終
レポートを
作成する
プロジェクトを
審査する
ビジネス
理解
データ
理解
データ
準備
評価
展開
データ
モデリング
8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
マシン・ラーニング(機械学習)
• 連想される言葉
–人工知能、画像認識、自然言語処理、自動運転、
ディープラーニング、データマイニング、R、Python
明示的にプログラムしなくても
学習する能力をコンピュータに与える
• 教師あり学習
• 教師なし学習
9
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 10
顧客情報 (属性値や、過去の利用状況など)から、
その顧客が今後優良顧客になる可能性を算出したい
分類モデル
顧客データ
このモデルをどうやって
作成するのか?
この顧客は優良顧客か?
その確率は?
・顧客ID
・性別
・所在地
・継続期間
・前月請求額
・・・
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 11
機械学習によるモデル作成
アルゴリズム
• 重回帰
• SVM
• 決定木
…
顧客データ
= 学習用データ
・顧客ID
・性別
・所在地
・継続期間
・前月請求額
・・・
・優良顧客フラグ
過去データ
目的達成です!
アルゴリズムを選択
顧客データとアルゴリズムによって
自動生成
予測された優良顧客リスト
分類モデル
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
自動生成されるモデルのイメージ
12
ID 性別 年齢 職業 前月請求額 ロイヤル
101 男性 31 会社員 10,000円 NO
102 女性 28 主婦 5,000円 YES
103 女性 36 主婦 200円 NO
104 男性 43 会社員 3,000円 NO
105 女性 22 会社員 7,000円 YES
過去顧客データ
ID 性別 年齢 職業 前月請求額 ロイヤル
314 男性 40 会社員 4,000円 NO
315 女性 26 会社員 5,500円 YES
新規顧客データ
前月請求額
<5,000円 >=5,000円
女性男性
性別
ロイヤル= NO
ロイヤル= YES
ロイヤル= NO
IF ( 前月請求額 >= 5000
AND 性別 = “女性” )
THEN
ロイヤル= YES
Probability = 0.77(信頼度)
Support = 0.250(組み合わせの出現率)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
テーマ イメージ図 アルゴリズム 応用範囲の例
分類
Logistic Regression (GLM)
Decision Trees
Naïve Bayes
Support Vector Machines (SVM)
ロイヤルカスタマーの予測
稼働会員から外れる会員の予測
不正送金の予測
クレジットリスクの予測
回帰
Linear Regression (GLM)
Support Vector Machine (SVM)
特定商品の売り上げを予測
特定顧客の消費金額を予測
異常検出 One Class SVM 異常な送金行為の検知
クラスタリング
Hierarchical k-Means
Hierarchical O-Cluster
Expectation-Maximization Clustering (EM)
会員のグルーピング
商品のグルーピング
相関ルール Apriori バスケット分析/ NBO(Next Best Offer)分析
属性重要度
Minimum Description Length (MDL)
Principal Components Analysis (PCA)
属性の絞り込み、ノイズの低減
特徴抽出
Nonnegative Matrix Factorization (NMF)
Singular Value Decomposition (SVD)
因子分析
機械学習アルゴリズムと活用例マッピング
A1 A2 A3 A4 A5 A6
F1 F2 F3 F4
13
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
テーマ イメージ図 アルゴリズム 応用範囲の例
分類
Logistic Regression (GLM)
Decision Trees
Naïve Bayes
Support Vector Machines (SVM)
伝統的な統計テクニック
幅広い用途に利用可能
回帰
Linear Regression (GLM)
Support Vector Machine (SVM)
伝統的な統計テクニック
幅広い用途に利用可能
異常検出 One Class SVM 不正検知や異常値の検出
クラスタリング
Hierarchical k-Means
Hierarchical O-Cluster
Expectation-Maximization Clustering (EM)
製品のグルーピング
遺伝子-タンパク質分析
相関ルール Apriori バスケット分析、事前の提案分析
属性重要度
Minimum Description Length (MDL)
Principal Components Analysis (PCA)
属性の絞り込み、ノイズの低減
特徴抽出
Nonnegative Matrix Factorization (NMF)
Singular Value Decomposition (SVD)
テキスト分析 / 因子分析
機械学習アルゴリズムと活用例マッピング
A1 A2 A3 A4 A5 A6
F1 F2 F3 F4
14
教師あり学習
教師なし学習
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
教師あり学習・教師なし学習とは
教師あり学習
コンピュータに「例題と正解」を学習させ
て、パターンを導き出す
教師なし学習
コンピュータ自身で「正解のないデータ」
から、共通要素を導き出す
15
Name Age Sex Result
Naoki 28 M 入る
Takao 42 M 入る
Hana 22 F 入らない
Toki 64 F 入る
(データ)
例題
(人間が教える)
正解
Sex = M
Age > 25
Yes No
Yes No
入る
入る 入らない
機械学習によって作られるモデル
Name Age Sex Salary
Naoki 28 M 100
Takao 42 M 500
Hana 22 F 100
Toki 64 F 100
(データ)
例題
Naoki
Takao
Toki
Hana
グループB
グループA
機械学習によって作られるモデル
年齢>26
かつ
年収>100
年齢<22
かつ
年収<100
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
分析する対象データの呼称
16
Name Age Sex Result
Naoki 28 M 入る
Takao 42 M 入る
Hana 22 F 入らない
Toki 64 F 入る
(データ)
例題
(人間が教える)
正解
説明変数
機械学習のアルゴリズムの
要素となるデータ
目的変数
予測したい数値/ラベル
※教師あり学習の場合にのみ存在
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
代表的なアルゴリズム
教師あり学習 • 教師なし学習
17
分類
(出力:ラベル)
ロジスティック回帰
サポートベクター
マシン(SVM)
決定木
回帰
(出力:数値)
線形モデル
サポートベクター
マシン(SVM)
クラスタリング
K-Means
階層型
クラスタリング
異常検出
One Class
SVM
相関ルール
Apriori
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
教師あり学習のアルゴリズム
• 分類
– カテゴリを予測するアルゴリズム
18
No 使用期間 落下回数 原因
1 3 1 電源
2 5 3 電源
3 4 3 電源
4 2 10 CPU
5 3 6 CPU
6 5 2 CPU
使用期間
落下回数
例) PCの故障原因
PCの使用期間と、PCの落下回数から、故障原因の傾向を予測するモデルを作成
故障原因:CPU
故障原因:電源
y=ax+bこれまでにPCが故障した原因
を収集したデータ
電源であると予測
このデータの故障原因は??
使用期間:4年
落下回数:5回
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
教師あり学習のアルゴリズム
• 回帰
– 実測値を予測するアルゴリズム
19
No 広告費 売り上げ
1 20 100
2 30 105
3 22 98
4 50 150
5 40 140
6 10 70
広告費
売り上げ
例) 車の売り上げ予測
車の月毎の広告費と月毎の売り上げの関係から、広告費が予測するモデルを作成
これまでの月毎の
広告費と売り上げ実績
210であると予測
広告費を80とした場合の
売り上げは??
80
210
y=ax+b
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
教師なし学習のアルゴリズム
• クラスタリング
– データの性質(類似性)を理解する、性質の近いデータ毎にグループ分けする
アルゴリズム
※分類と異なり、目的関数がないことに注意
20
年齢
購入金額
例) カメラ購入者の傾向
カメラを購入者の傾向を分析するモデルを作成
購入したカメラと消費者のデータ
No 性別 年齢 購入金額
1 男性 65 120,000
2 男性 33 60,000
3 女性 28 45,000
4 女性 32 59,000
5 女性 59 32,000
6 男性 45 100,000
高級なカメラを宣伝する
80歳、男性へのアプローチは??
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
• 予測的分析が要件となっている
• データ活用が重要視されている
• 過去データが大量に存在している
• 潜在的なパターンを持っている
• 予測分析を必要としていない
• ビジネスルールが重要視される
• 過去データがあまり存在しない
• 予測可能なパターンを持たない
21
機械学習が向いていること・いないこと
役に立てます! 役に立てません。
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
オラクル・マシン・ラーニング
22
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 23
アナリティクスSQLをデータベースに、そしてクラウドへ
Oracleの機械学習の進化
Thinking Machines
Corporation “Darwin”
Oracle Data Mining
“Java API”
Oracle Data Mining
“PL/SQL”
Oracle Data Miner
“Classic”
Oracle R Enterprise
Oracle Advanced
Analytics
Oracle Data Miner
Oracle R Advanced
Analytics for Hadoop
Oracle
Analytics Cloud
1998 2002 20092004 20152012
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 24
Oracle Analytics Cloud
R
データ連携 データマネジメント
&
データ分析
データビジュアライズ
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Internet of
Things Cloud
デバイスのエンタープライズ
との統合を標準化し、
データ・ストリームを
リアルタイムに分析できます
Integration Cloud
ブラウザをクリックする
タイプのデザイナで、
クラウド資産との統合が
加速されます
SOA Cloud
統合に関する課題
すべてを満たし、柔軟性を
提供する幅広く深い完全な
開発ツール
GoldenGate Cloud
オンプレミス型リレーショナ
ル・データベースからクラウド
内のデータベースへのシー
ムレスでリアルタイムのデー
タ移行を提供
データ連携
25
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
R
データマネジメント&データ分析
Database Cloud
機械学習エンジンを含む、
Oracle Databaseの
全オプションを利用可能な
クラウド・データベース・
プラットフォーム
Exadata Cloud
世界No.1のデータベース
とExadataを組み合せた、
世界でもっとも優れた
クラウド・データベース・
プラットフォーム
Big Data Cloud
Hadoopのビッグ・データ環境
を、セキュアで自動化され、
拡張の柔軟性に富んだサー
ビスとして提供
Big Data
Preparation Cloud
非構造化データ、半構造化
データ、および構造化データ
を、対話形式で直感的に準
備し、後続のプロセスに渡す
26
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
データビジュアライズ
Business
Intelligence Cloud
ワークグループから
エンタープライズまでの
全ユーザーに提供できる、
実績あるプラットフォーム
Data
Visualization Cloud
優れた視覚的な分析および
セルフサービス検出により、
対象を瞬時に明確化
Big Data
Discovery Cloud
Hadoop上のデータを
ビジネス・インサイトへと変換
Sites Cloud
テーマ、コンテンツ、
コンポーネントおよび
アプリケーションからWeb
およびモバイル・サイトを構築
27
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Analytics Cloud + Oracle Cloud Map
取得 加工・蓄積 分析 描写
バ
ッ
チ
リ
ア
ル
タ
イ
ム
IoTIoT
Gateway & SDKs
Storage
Big Data Preparation
Big Data
Big Data Discovery
Oracle Database
Advanced Analytics
BI
Apps
Data Visualization
Site
Apps
28
Sensors
File Server
DB Server
Devices
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle Data Miner/デモンストレーション
29
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 30
Oracle Data Minerアーキテクチャ
ODMRSYS
Data Miner
リポジトリ
USERS
機械学習用
テーブル/ビュー
サービス
Data Mining
XML DB
Scheduler
Text
SQL Developer
+ Data Miner
SQL, PL/SQL
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle Advanced Analytics
Oracle Data Miner GUI
• GUIによる操作で分析フローを設計
• フローをイメージで保存可能
• クライアントツールから
データベースを操作
• 複雑な機械学習の処理を
自動で同時実行
• モデリングに適したデータに
自動変換
• ETL処理も実行可能
31
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle Data Minerの主な概念
用語 概要 補足
ユーザースキーマ データベース接続スキーマ
データマイニング実施アカウント
複数作成可能
プロジェクト 分析プロジェクト ワークフローの集合体
プロジェクト名とコメントを付与可能
ワークフロー データマイニングオペレーション
(モデリング、テスト、スコアリング)の設計領域
ノードが結びついたもの
ノードの組み合わせによって、
データマイニングオペレーションを設計可能
ノード データノード
変換ノード
テキストノード
モデルノード
予測問合せノード
評価と適用ノード
リンクノード
ノード間を接続して、フローを実現
名前とコメントを付与可能
詳細パラメータを設定できる
ノード単位で実行を行える
※実行に必要な他のノードがあれば、
そちらも自動的に実行される
ノードのステータスが表示
32
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
データベース
ユーザースキーマ
Oracle Data Minerの各概念の関係
33
プロジェクト
ワークフロー ワークフロー
プロジェクト
ワークフロー
ユーザースキーマ
プロジェクト
ワークフロー ワークフロー
ノード
ノード
ノード
ノード
ノード
ノード
ノード
ノード
ノード
ノード
ノード
ノード
ノード
ノード
1つのユーザースキーマで複数
のプロジェクトを利用可能
ノード間を接続して
フローを記述
一つのプロジェクトに複数の
ワークフローを作成可能
ノード
ノード
ノード
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
DEMO
For
Oracle Data Miner
34
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 35
環境価格 1時間 $6.720 ≒ 800円
Oracle Database Cloud Service
+ Oracle Advanced Analytics
(Oracle Data Mining)
Oracle Application Express
Oracle REST Data Services
Data Miner GUI
Oracle SQL Developer
https://
Mobiles $6.720 / hour
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
オラクルRテクノロジー
36
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
OracleにおけるRテクノロジー
• オラクルは, 統計分析や高度な分析, 高機能グラフの生成をサポートする
言語および環境としてRを採用
• オラクルはR consortiumの創設メンバー
– RIOT 2016のオーガナイザー
• オラクルは次の4つのキーテクノロジーを通じてRの統合を提供
– Oracle R Distribution
– ROracle
– Oracle R Enterprise (ORE)
– Oracle R Advanced Analytics for Hadoop (ORAAH)
37
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle R Distribution
• オラクルがサポートするオープンソースRのディストリビューション
• 無料でダウンロード可能
• MKL, ACML, Solaris Sun Performance Libraryを動的にロードできる
機能拡張がされている
• Oracle Advanced Analytics, Oracle Linux, Oracle Big Data Applianceの
ユーザーに対してはサポートを提供
38
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
ROracle
• オラクルが管理するオープンソースRパッケージ
• OCIライブラリに基づいたDBI準拠のOracleドライバ
• Oracle Databaseに接続でき, ユーザー指定のSQL文について
トランザクション・レベルの制御と実行が可能
• CRANで公開されており, オラクルによってメンテナンス
39
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle R Enterprise (ORE)
• Oracle Advanced Analyticsのコンポーネント
• オープンソースRとOracle Databaseの統合
• データベースのパラレル処理機能やスケーラビリティを活用
• Rの処理をSQLに透過的に変換
• Rスクリプトをデータ分析サーバで実行
40
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle R Advanced Analytics for Hadoop (ORAAH)
• Big Data Connectorsのコンポーネント
• HDFSとMapReduceフレームワークに対してのRインターフェースを提供
• Sparkベースの分析アルゴリズムも提供
• Oracle R Enterpriseと透過的に動作
41
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle R Enterprise
42
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
従来のRの制限
• メモリの制約
• データをメモリ上に展開しての演算処理
• 処理データ量に制限
• 大規模データの扱いには向いていない
• 処理に応じて繰り返されるメモリへのデータロード
• メモリ・リソースが枯渇しやすい
• シングル・スレッド処理
• マルチコア環境で性能のスケーラビリティが低い
43
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle R Enterprise
• データベースの機能としてRの実行環境を提供
– データフレーム上またはOracle表/View上でRを実行可能
– コマンド、コンソール、ワークスペースはRと同じものを提供
• 企業のデータベースをRで利用
– データベース内のデータに対してダイレクトかつ透過的に処理
– 大規模データセットをRで扱うことが可能
• 高いパフォーマンス
– プログラミングレスで並列処理をDB内にて実行
44
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
高パフォーマンス
45
• データ量が増えるとその差は顕著
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Spawned R Engine
Spawned R Engine
Spawned R Engine
Oracle R Enterprise アーキテクチャ
46
Database Server
R Engine
Other R packages
Oracle R Enterprise packages
R
Client
Spawned R Engine
Other R packages
Oracle R Enterprise packages
SQL
結果 結果
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle R Enterprise コンポーネント
47
Database ServerClient
SQL
結果
Operating System
Oracle R
Distribution
Oracle R
Enterprise
Client Oracle
DB
Client
Oracle R
Enterprise
supporting
Packages
Operating System
Oracle R
Distribution
Oracle R
Enterprise Server
Oracle R
Enterprise
supporting
Packages
Oracle
DB
/w
AA
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle R Enterpriseのメリット
• Rコマンドからデータベース内の
データを操作可能
• データの「移動」をなくす
• データセキュリティ
• データベースのパワーで分析
• データベース内でデータ準備
• Rオブジェクトをデータベースに保存
• モデルをデータベース内に作成
• データベース内でスコアリング
• Rスクリプトをデータベースで実行
• オラクルの他サービスと連携可能
48
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
インデータベース分析
49
従来のデータ分析
数時間, 数日, 数週間
Oracle R Enterprise
数秒, 数分, 数時間
Data Import
Data Mining & Model "Scoring"
Data Preparation & Transformation
Data Mining & Model Building
Data Preparation & Transformation
Data Extraction
Model "Scoring"
Data Preparation
Model Building
Data Preparation
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
ore.frame
• ore.frameというdata.frameのサブクラス
• データベーステーブルのプロキシとしてore.frameオブジェクトを利用可能
• データベース内のデータをクライアントに持ってくることなく処理可能
50
R> class(TITANIC01)
[1] "ore.frame"
attr(,"package")
[1] "OREbase"
R> colnames(TITANIC01)
[1] "Class" "Sex" "Age"
"Survived" "Freq"
R> mean(TITANIC01$Freq)
[1] 68.78125
Database Server
R Engine
Other R packages
Oracle R Enterprise packages
Client
SQL
結果
ore.frame
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Invoke in-database aggregation function
R: Transparency through function overloading
> aggdata <- aggregate(ONTIME_S$DEST,
+ by = list(ONTIME_S$DEST),
+ FUN = length)
ONTIME_S
In-db
Stats
Oracle SQL
select DEST, count(*)
from ONTIME_S
group by DEST
Oracle Advanced Analytics
ORE Client Packages
Transparency Layer
> class(aggdata)
[1] "ore.frame"
attr(,"package")
[1] "OREbase"
> head(aggdata)
Group.1 x
1 ABE 237
2 ABI 34
3 ABQ 1357
4 ABY 10
5 ACK 3
6 ACT 33
Oracle Distribution of R version 3.1.1 (--) -- "Sock it to Me"
51
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
参考)サポートされるR演算子およびR関数(ORE 1.4.1, 1.5)
52
• 数学的変換: abs, sign, sqrt, ceiling, floor, trunc, cummax, cummin, cumprod,
cumsum, log, loglo, log10, log2, log1p, acos, acosh, asin, asinh, atan, atanh,
exp, expm1, cos, cosh, sin, sinh, tan, atan2, tanh, gamma, lgamma,
digamma, trigamma, factorial, lfactorial, round, signif, pmin, pmax, zapsmall,
rank, diff, besselI, besselJ, besselK, besselY
• 基本統計: mean, summary, min, max, sum, any, all, median, range, IQR,
fivenum, mad, quantile, sd, var, table, tabulate, rowSums, colSums,
rowMeans, colMeans, cor, cov
• 算術演算子: +, -, *, /, ^, %%, %/%
• 比較演算子: ==, >, <, !=, <=, >=
• 論理演算子: &, |, xor
• 集合演算子: unique, %in%, subset
• 文字列演算: tolower, toupper, casefold, toString, chartr, sub, gsub, substr,
substring, paste, nchar, grepl
• データ・フレームの結合: cbind, rbind, merge
• ベクトルの結合: append
• ベクトルの作成: ifelse
• サブセットの選択: [, [[, $, head, tail, window, subset, Filter, na.omit,
na.exclude, complete.cases
• サブセットの置換: [<-, [[<-, $<-
• データの再編成: split, unlist
• データ処理: eval, with, within, transform
• applyのバリアント: tapply, aggregate, by
• 特別な値のチェック: is.na, is.finite, is.infinite, is.nan
• メタデータ関数: nrow, NROW, ncol, NCOL, nlevels, names, names<-, row, col,
dimnames, dimnames<-, dim, length, row.names, row.names<-, rownames,
rownames<-, colnames, levels, reorder
• グラフィック: arrows, boxplot, cdplot, co.intervals, coplot, hist, identify, lines,
matlines, matplot, matpoints, pairs, plot, points, polygon, polypath, rug,
segments, smoothScatter, sunflowerplot, symbols, text, xspline, xy.coords
• 変換関数: as.logical, as.integer, as.numeric, as.character, as.vector, as.factor,
as.data.frame
• 型チェック関数: is.logical, is.integer, is.numeric, is.character, is.vector,
is.factor, is.data.frame
• 文字の操作: nchar, tolower, toupper, casefold, chartr, sub, gsub, substr
• その他のore.frame関数: data.frame, max.col, scale
• 仮説検定: binom.test, chisq.test, ks.test, prop.test, t.test, var.test, wilcox.test
• 各種分布: 密度, 累積分布, および標準分布のクォンタイル関数
• ore.matrix関数: show, is.matrix, as.matrix, %*% (マトリクスの乗算), t,
crossprod (マトリクスのクロス積), tcrossprod (BをA回転置したマトリクスのクロ
ス積), solve (反転), backsolve, forwardsolve, すべての適切な算術関数(abs, sign
など), summary (max, min, allなど), mean
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
ore.pull
• ore.pull関数でDB上のデータを取得しRのdata.frameに強制Cast
• データをDBからクライアントに持ってきて, 処理を実行
• 処理オフロードはされないが, 既存Rスクリプトをそのまま使用可能
53
R> df_titanic <- ore.pull(TITANIC01)
R> class(df_titanic)
[1] "data.frame"
Database Server
R Engine
Other R packages
Oracle R Enterprise packages
Client
ore.pull
データ
data.frame
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
ore.push
• ore.push関数でデータベースに一時オブジェクトとしてRオブジェクトを格納
• データをクライアントからDBに格納し, 処理を実行
• セッションクローズ後にも保存する際には、ore.save関数を利用
54
R> v <- ore.push(c(1,2,3,4,5))
R> class(v)
[1] "ore.numeric"
attr(,"package")
[1] "OREbase"
R> head(v)
[1] 1 2 3 4 5
R> ore.save(v,name="ds_1")
Database Server
R Engine
Other R packages
Oracle R Enterprise packages
Client
ore.push
データ
data.object
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
モデル構築とスコアリング
• 2種類のカテゴリが存在
– Oracle R Enterprise models(OREmodels package)
• linear regression, generalized linear model, neural network, random forest classification, stepwise
linear regression
– Oracle Data Mining models(OREdm package)
• minimum description length, apriori, decision tree, generalized linear models, k-means, naive bayes,
non-negative matrix factorization, orthogonal partitioning cluster (O-Cluster), support vector
machines
• ore.frameオブジェクトに対して, ore.predictでスコアリング可能
– 対応しているモデル・オブジェクトであれば, OREmodels, OREdm以外にも使用可能
55
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Invoke ORE custom parallel distributed model (Linear Regression)
R: Scalable Machine Learning Models
> options(ore.parallel=4)
> lm_mod <- ore.lm(ARRDELAY ~ DISTANCE + DEPDELAY,
data=ONTIME_S)
Oracle Advanced Analytics
ORE Client Packages
Transparency Layer
extproc
extproc
extproc
extproc
3
2
ONTIME_S
Parallel
ORE
Framework
1
> summary(lm_mod)
Call:
ore.lm(formula = ARRDELAY ~ DISTANCE + DEPDELAY, data = ONTIME_S)
Residuals:
Min 1Q Median 3Q Max
-1462.45 -6.97 -1.36 5.07 925.08
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.254e-01 5.197e-02 4.336 1.45e-05 ***
DISTANCE -1.218e-03 5.803e-05 -20.979 < 2e-16 ***
DEPDELAY 9.625e-01 1.151e-03 836.289 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 14.73 on 215144 degrees of freedom
(4785 observations deleted due to missingness)
Multiple R-squared: 0.7647, Adjusted R-squared: 0.7647
F-statistic: 3.497e+05 on 2 and 215144 DF, p-value: < 2.2e-16 56
Oracle Distribution of R version 3.1.1 (--) -- "Sock it to Me"
Oracle R Distribution
Parallel ore.lm Compute
R Packages
Oracle R Distribution
Parallel ore.lm Compute
R Packages
Oracle R Distribution
Parallel ore.lm Compute
R Packages
4
Oracle R Distribution
Parallel Compute Engine
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Invoke in-database Data Mining model (Support Vector Machine)
R: Scalable Machine Learning Models
> svm_mod <- ore.odmSVM(BUY~INCOME+YRS_CUST+MARITAL_STATUS,
data=CUST,"classification")
CUST
In-db
Mining
Model
Oracle PL/SQL
BEGIN
DBMS_DATA_MINING.CREATE_MODEL(
model_name => ’SVM_MOD’,
mining_function =>
dbms_data_mining.classification
...
Oracle Advanced Analytics
ORE Client Packages
Transparency Layer
> summary(svm_mod)
Call:
ore.odmSVM(formula = BUY ~ INCOME + YRS_CUST + MARITAL_STATUS, data = CUST,
type = "classification", kernel.function = "linear")
Settings:
value
prep.auto on
active.learning al.enable
complexity.factor 46.044899
conv.tolerance 1e-04
kernel.function linear
Coefficients:
class variable value estimate
1 0 INCOME 5.204561e-05
2 0 MARITAL_STATUS M -4.531359e-05
3 0 MARITAL_STATUS S 4.531359e-05
4 0 YRS_CUST 1.264948e-04
5 0 (Intercept) 9.999269e-01
6 1 INCOME 2.032340e-05
7 1 MARITAL_STATUS M 2.636552e-06
8 1 MARITAL_STATUS S -2.636555e-06
9 1 YRS_CUST -1.588211e-04
10 1 (Intercept) -9.999324e-01
57
Oracle Distribution of R version 3.1.1 (--) -- "Sock it to Me"
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
参考)ORE関数
> unique(apropos("^ore"))
[1] "ore.attach" "ore.connect" "ore.const" "ore.corr"
[5] "ore.create" "ore.crosstab" "ore.datastore" "ore.datastoreSummary"
[9] "ore.delete" "ore.detach" "ore.disconnect" "ore.doEval"
[13] "ore.drop" "ore.esm" "ore.exec" "ore.exists"
[17] "ore.frame" "ore.freq" "ore.get" "ore.getXlevels"
[21] "ore.getXnlevels" "ore.glm" "ore.glm.control" "ore.groupApply"
[25] "ore.hash" "ore.hiveOptions" "ore.hour" "ore.indexApply"
[29] "ore.is.connected" "ore.lazyLoad" "ore.lm" "ore.load"
[33] "ore.ls" "ore.make.names" "ore.mday" "ore.minute"
[37] "ore.month" "ore.neural" "ore.odmAI" "ore.odmAssocRules"
[41] "ore.odmDT" "ore.odmGLM" "ore.odmKMeans" "ore.odmNB"
[45] "ore.odmNMF" "ore.odmOC" "ore.odmSVM" "ore.predict"
[49] "ore.pull" "ore.push" "ore.rank" "ore.recode"
[53] "ore.rm" "ore.rollmax" "ore.rollmean" "ore.rollmin"
[57] "ore.rollsd" "ore.rollsum" "ore.rollvar" "ore.rowApply"
[61] "ore.save" "ore.scriptCreate" "ore.scriptDrop" "ore.second"
[65] "OREShowDoc" "ore.showHiveOptions" "ore.sort" "ore.stepwise"
[69] "ore.summary" "ore.sync" "ore.tableApply" "ore.toXML"
[73] "ore.univariate" "ore.year"
58
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
埋込み(Embeded)R
• データベース側にスクリプトや関数を送り込み, データベースで実行
• データベースサーバ内で外部プロシージャ形式でRが起動
– DBサーバにRパッケージを追加することで様々なパッケージに対応
• データを分割し, 複数のRプロセスを起動し並列処理可能
59
Database Server
R Engine
Other R packages
Oracle R Enterprise packages
Client
結果
exec
R script
Spawned R EngineSpawned R EngineRプロシージャ
Spawned R Engine
Other R packages
Oracle R Enterprise packages
結果
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Server execution of open-source R package: Embedded R with ore.tableApply()
R: Embedded R for using open-source R Packages
> mod_biglm <- ore.tableApply(dat = ONTIME_S, # Database table
function(dat) {
library(biglm) # Load open-source package
biglm(ARRDELAY ~ DISTANCE + DEPDELAY, dat)
});
Oracle Advanced Analytics
ORE Client Packages
Embedded R
extproc
3
2
ONTIME_S
Embedded R
ORE
Framework
1
> library(biglm) # Load open-source package locally to interpret results
> summary(mod_biglm) # Summary of the resulting Model
Large data regression model: biglm(ARRDELAY ~ DISTANCE + DEPDELAY, dat)
Sample size = 392805
Coef (95% CI) SE p
(Intercept) 0.0638 -0.7418 0.8693 0.4028 0.8742
DISTANCE -0.0014 -0.0021 -0.0006 0.0004 0.0002
DEPDELAY 1.0552 1.0373 1.0731 0.0090 0.0000
60
Oracle Distribution of R version 3.1.1 (--) -- "Sock it to Me"
Oracle R Distribution
Open-source R Packages
4
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Server execution of open-source R package: Embedded R + parallel group-by ore.groupApply()
R: Embedded R for using open-source R Packages
> options(ore.parallel=4)
> modList <- ore.groupApply(dat = ONTIME_S, # Database table
INDEX = ONTIME_S$DEST,# groupby col
function(dat) {
library(biglm) # Load open-source package
biglm(ARRDELAY ~ DISTANCE + DEPDELAY, dat)
});
> library(biglm) # Load open-source package locally to interpret results
> summary(modList) # Checks how many models we have in the model list
Length Class Mode
325 ore.list S4
> summary(modList$BOS) # Request the resulting Model for Boston Logan Airport
Large data regression model: biglm(ARRDELAY ~ DISTANCE + DEPDELAY, dat)
Sample size = 3928
Coef (95% CI) SE p
(Intercept) 0.0638 -0.7418 0.8693 0.4028 0.8742
DISTANCE -0.0014 -0.0021 -0.0006 0.0004 0.0002
DEPDELAY 1.0552 1.0373 1.0731 0.0090 0.0000
Oracle Distribution of R version 3.1.1 (--) -- "Sock it to Me" Oracle Advanced Analytics
ORE Client Packages
Transparency Layer
extproc
extproc
extproc
extproc
3
2
ONTIME_S
Parallel
ORE
Framework
1
61
Oracle R Distribution
Open-source R Packages
R Packages
Oracle R Distribution
Open-source R Packages
R Packages
Oracle R Distribution
Open-source R Packages
R Packages
4
Oracle R Distribution
Open-source R Packages
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 62
環境価格 1時間 $6.720 ≒ 800円
Oracle Application Express
Oracle REST Data Services
Oracle R Distribution
https://
Mobiles $6.720 / hour
Oracle Database Cloud Service
+ Oracle Advanced Analytics
(Oracle R Enterprise)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 63
オラクル・マシン・ラーニング・コンセプト
Hadoop Relational
Algorithms
Common core, parallel, distributed
SQL RGUI
Cloud
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 64
Oracle advanced analyticsによる機械学習full version

Oracle advanced analyticsによる機械学習full version

  • 1.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 機械学習テクニカルセッション Oracle Advanced AnalyticsによるIn-Database Machine Learning 日本オラクル株式会社 クラウド・テクノロジー事業統括 PaaS事業推進室 ソリューション・アーキテクト部 クラウドアーキテクト 小川幹雄
  • 2.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 3.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | アジェンダ • 機械学習概要 • オラクル・マシン・ラーニング • Oracle Data Miner/デモンストレーション • オラクルRテクノロジー全体概要 • Oracle R Enterprise 3
  • 4.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 機械学習概要紹介 4
  • 5.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 従来型BIからBusiness Analyticsへのシフト 5 V A L U E D I F F I C U L T 何が起きたのか? Descriptive Analytics どうして起きたのか? Diagnostic Analytics 何が起きるのか? Predictive Analytics どうやって起こせるのか? Prescriptive Analytics 従来型BI Business Analytics
  • 6.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 20% 予測モデル導入によるROI最大化 全体の何割にアプローチするか 100%0% ターゲット層へヒットする割合 100% 20% 50%20% 70% 50% ROI 顧客をランダムで選択 機械学習を使用 6
  • 7.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 製品開発 Operation & Human Capital ファクトリーIoT Industry 4.0 Business Analyticsの活用例 7 営業ターゲット 不正送金クロスセル Sales & Marketing Finance クレジットリスク 技術開発 タレント育成 オムニチャネル カスタマー360 メンタルケア
  • 8.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | データ分析におけるPDCAサイクル (CRISP-DM) ビジネス 理解 データ 理解 データ 準備 データ モデリング 評価 展開 ビジネス 目的を 決定する 状況を 評価する 分析の ゴールを 決定する プロジェクト 計画を建てる 初期 データを 収集する データを 記述する データを 調べる データの 品質を 検証する データを 選択する データを 整理する データを 構築する データを 統合する データを 設定する モデリング 手法を 選択する テスト 結果を 生成する モデルを 構築する モデルを 評価する 結果を 評価する プロセスを 審査する 次の ステップを 決定する 展開を 計画する 運用を 計画する 最終 レポートを 作成する プロジェクトを 審査する ビジネス 理解 データ 理解 データ 準備 評価 展開 データ モデリング 8
  • 9.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | マシン・ラーニング(機械学習) • 連想される言葉 –人工知能、画像認識、自然言語処理、自動運転、 ディープラーニング、データマイニング、R、Python 明示的にプログラムしなくても 学習する能力をコンピュータに与える • 教師あり学習 • 教師なし学習 9
  • 10.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 10 顧客情報 (属性値や、過去の利用状況など)から、 その顧客が今後優良顧客になる可能性を算出したい 分類モデル 顧客データ このモデルをどうやって 作成するのか? この顧客は優良顧客か? その確率は? ・顧客ID ・性別 ・所在地 ・継続期間 ・前月請求額 ・・・
  • 11.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 11 機械学習によるモデル作成 アルゴリズム • 重回帰 • SVM • 決定木 … 顧客データ = 学習用データ ・顧客ID ・性別 ・所在地 ・継続期間 ・前月請求額 ・・・ ・優良顧客フラグ 過去データ 目的達成です! アルゴリズムを選択 顧客データとアルゴリズムによって 自動生成 予測された優良顧客リスト 分類モデル
  • 12.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 自動生成されるモデルのイメージ 12 ID 性別 年齢 職業 前月請求額 ロイヤル 101 男性 31 会社員 10,000円 NO 102 女性 28 主婦 5,000円 YES 103 女性 36 主婦 200円 NO 104 男性 43 会社員 3,000円 NO 105 女性 22 会社員 7,000円 YES 過去顧客データ ID 性別 年齢 職業 前月請求額 ロイヤル 314 男性 40 会社員 4,000円 NO 315 女性 26 会社員 5,500円 YES 新規顧客データ 前月請求額 <5,000円 >=5,000円 女性男性 性別 ロイヤル= NO ロイヤル= YES ロイヤル= NO IF ( 前月請求額 >= 5000 AND 性別 = “女性” ) THEN ロイヤル= YES Probability = 0.77(信頼度) Support = 0.250(組み合わせの出現率)
  • 13.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | テーマ イメージ図 アルゴリズム 応用範囲の例 分類 Logistic Regression (GLM) Decision Trees Naïve Bayes Support Vector Machines (SVM) ロイヤルカスタマーの予測 稼働会員から外れる会員の予測 不正送金の予測 クレジットリスクの予測 回帰 Linear Regression (GLM) Support Vector Machine (SVM) 特定商品の売り上げを予測 特定顧客の消費金額を予測 異常検出 One Class SVM 異常な送金行為の検知 クラスタリング Hierarchical k-Means Hierarchical O-Cluster Expectation-Maximization Clustering (EM) 会員のグルーピング 商品のグルーピング 相関ルール Apriori バスケット分析/ NBO(Next Best Offer)分析 属性重要度 Minimum Description Length (MDL) Principal Components Analysis (PCA) 属性の絞り込み、ノイズの低減 特徴抽出 Nonnegative Matrix Factorization (NMF) Singular Value Decomposition (SVD) 因子分析 機械学習アルゴリズムと活用例マッピング A1 A2 A3 A4 A5 A6 F1 F2 F3 F4 13
  • 14.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | テーマ イメージ図 アルゴリズム 応用範囲の例 分類 Logistic Regression (GLM) Decision Trees Naïve Bayes Support Vector Machines (SVM) 伝統的な統計テクニック 幅広い用途に利用可能 回帰 Linear Regression (GLM) Support Vector Machine (SVM) 伝統的な統計テクニック 幅広い用途に利用可能 異常検出 One Class SVM 不正検知や異常値の検出 クラスタリング Hierarchical k-Means Hierarchical O-Cluster Expectation-Maximization Clustering (EM) 製品のグルーピング 遺伝子-タンパク質分析 相関ルール Apriori バスケット分析、事前の提案分析 属性重要度 Minimum Description Length (MDL) Principal Components Analysis (PCA) 属性の絞り込み、ノイズの低減 特徴抽出 Nonnegative Matrix Factorization (NMF) Singular Value Decomposition (SVD) テキスト分析 / 因子分析 機械学習アルゴリズムと活用例マッピング A1 A2 A3 A4 A5 A6 F1 F2 F3 F4 14 教師あり学習 教師なし学習
  • 15.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 教師あり学習・教師なし学習とは 教師あり学習 コンピュータに「例題と正解」を学習させ て、パターンを導き出す 教師なし学習 コンピュータ自身で「正解のないデータ」 から、共通要素を導き出す 15 Name Age Sex Result Naoki 28 M 入る Takao 42 M 入る Hana 22 F 入らない Toki 64 F 入る (データ) 例題 (人間が教える) 正解 Sex = M Age > 25 Yes No Yes No 入る 入る 入らない 機械学習によって作られるモデル Name Age Sex Salary Naoki 28 M 100 Takao 42 M 500 Hana 22 F 100 Toki 64 F 100 (データ) 例題 Naoki Takao Toki Hana グループB グループA 機械学習によって作られるモデル 年齢>26 かつ 年収>100 年齢<22 かつ 年収<100
  • 16.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 分析する対象データの呼称 16 Name Age Sex Result Naoki 28 M 入る Takao 42 M 入る Hana 22 F 入らない Toki 64 F 入る (データ) 例題 (人間が教える) 正解 説明変数 機械学習のアルゴリズムの 要素となるデータ 目的変数 予測したい数値/ラベル ※教師あり学習の場合にのみ存在
  • 17.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 代表的なアルゴリズム 教師あり学習 • 教師なし学習 17 分類 (出力:ラベル) ロジスティック回帰 サポートベクター マシン(SVM) 決定木 回帰 (出力:数値) 線形モデル サポートベクター マシン(SVM) クラスタリング K-Means 階層型 クラスタリング 異常検出 One Class SVM 相関ルール Apriori
  • 18.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 教師あり学習のアルゴリズム • 分類 – カテゴリを予測するアルゴリズム 18 No 使用期間 落下回数 原因 1 3 1 電源 2 5 3 電源 3 4 3 電源 4 2 10 CPU 5 3 6 CPU 6 5 2 CPU 使用期間 落下回数 例) PCの故障原因 PCの使用期間と、PCの落下回数から、故障原因の傾向を予測するモデルを作成 故障原因:CPU 故障原因:電源 y=ax+bこれまでにPCが故障した原因 を収集したデータ 電源であると予測 このデータの故障原因は?? 使用期間:4年 落下回数:5回
  • 19.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 教師あり学習のアルゴリズム • 回帰 – 実測値を予測するアルゴリズム 19 No 広告費 売り上げ 1 20 100 2 30 105 3 22 98 4 50 150 5 40 140 6 10 70 広告費 売り上げ 例) 車の売り上げ予測 車の月毎の広告費と月毎の売り上げの関係から、広告費が予測するモデルを作成 これまでの月毎の 広告費と売り上げ実績 210であると予測 広告費を80とした場合の 売り上げは?? 80 210 y=ax+b
  • 20.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 教師なし学習のアルゴリズム • クラスタリング – データの性質(類似性)を理解する、性質の近いデータ毎にグループ分けする アルゴリズム ※分類と異なり、目的関数がないことに注意 20 年齢 購入金額 例) カメラ購入者の傾向 カメラを購入者の傾向を分析するモデルを作成 購入したカメラと消費者のデータ No 性別 年齢 購入金額 1 男性 65 120,000 2 男性 33 60,000 3 女性 28 45,000 4 女性 32 59,000 5 女性 59 32,000 6 男性 45 100,000 高級なカメラを宣伝する 80歳、男性へのアプローチは??
  • 21.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | • 予測的分析が要件となっている • データ活用が重要視されている • 過去データが大量に存在している • 潜在的なパターンを持っている • 予測分析を必要としていない • ビジネスルールが重要視される • 過去データがあまり存在しない • 予測可能なパターンを持たない 21 機械学習が向いていること・いないこと 役に立てます! 役に立てません。
  • 22.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | オラクル・マシン・ラーニング 22
  • 23.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 23 アナリティクスSQLをデータベースに、そしてクラウドへ Oracleの機械学習の進化 Thinking Machines Corporation “Darwin” Oracle Data Mining “Java API” Oracle Data Mining “PL/SQL” Oracle Data Miner “Classic” Oracle R Enterprise Oracle Advanced Analytics Oracle Data Miner Oracle R Advanced Analytics for Hadoop Oracle Analytics Cloud 1998 2002 20092004 20152012
  • 24.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 24 Oracle Analytics Cloud R データ連携 データマネジメント & データ分析 データビジュアライズ
  • 25.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Internet of Things Cloud デバイスのエンタープライズ との統合を標準化し、 データ・ストリームを リアルタイムに分析できます Integration Cloud ブラウザをクリックする タイプのデザイナで、 クラウド資産との統合が 加速されます SOA Cloud 統合に関する課題 すべてを満たし、柔軟性を 提供する幅広く深い完全な 開発ツール GoldenGate Cloud オンプレミス型リレーショナ ル・データベースからクラウド 内のデータベースへのシー ムレスでリアルタイムのデー タ移行を提供 データ連携 25
  • 26.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | R データマネジメント&データ分析 Database Cloud 機械学習エンジンを含む、 Oracle Databaseの 全オプションを利用可能な クラウド・データベース・ プラットフォーム Exadata Cloud 世界No.1のデータベース とExadataを組み合せた、 世界でもっとも優れた クラウド・データベース・ プラットフォーム Big Data Cloud Hadoopのビッグ・データ環境 を、セキュアで自動化され、 拡張の柔軟性に富んだサー ビスとして提供 Big Data Preparation Cloud 非構造化データ、半構造化 データ、および構造化データ を、対話形式で直感的に準 備し、後続のプロセスに渡す 26
  • 27.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | データビジュアライズ Business Intelligence Cloud ワークグループから エンタープライズまでの 全ユーザーに提供できる、 実績あるプラットフォーム Data Visualization Cloud 優れた視覚的な分析および セルフサービス検出により、 対象を瞬時に明確化 Big Data Discovery Cloud Hadoop上のデータを ビジネス・インサイトへと変換 Sites Cloud テーマ、コンテンツ、 コンポーネントおよび アプリケーションからWeb およびモバイル・サイトを構築 27
  • 28.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Analytics Cloud + Oracle Cloud Map 取得 加工・蓄積 分析 描写 バ ッ チ リ ア ル タ イ ム IoTIoT Gateway & SDKs Storage Big Data Preparation Big Data Big Data Discovery Oracle Database Advanced Analytics BI Apps Data Visualization Site Apps 28 Sensors File Server DB Server Devices
  • 29.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Oracle Data Miner/デモンストレーション 29
  • 30.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 30 Oracle Data Minerアーキテクチャ ODMRSYS Data Miner リポジトリ USERS 機械学習用 テーブル/ビュー サービス Data Mining XML DB Scheduler Text SQL Developer + Data Miner SQL, PL/SQL
  • 31.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Oracle Advanced Analytics Oracle Data Miner GUI • GUIによる操作で分析フローを設計 • フローをイメージで保存可能 • クライアントツールから データベースを操作 • 複雑な機械学習の処理を 自動で同時実行 • モデリングに適したデータに 自動変換 • ETL処理も実行可能 31
  • 32.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Oracle Data Minerの主な概念 用語 概要 補足 ユーザースキーマ データベース接続スキーマ データマイニング実施アカウント 複数作成可能 プロジェクト 分析プロジェクト ワークフローの集合体 プロジェクト名とコメントを付与可能 ワークフロー データマイニングオペレーション (モデリング、テスト、スコアリング)の設計領域 ノードが結びついたもの ノードの組み合わせによって、 データマイニングオペレーションを設計可能 ノード データノード 変換ノード テキストノード モデルノード 予測問合せノード 評価と適用ノード リンクノード ノード間を接続して、フローを実現 名前とコメントを付与可能 詳細パラメータを設定できる ノード単位で実行を行える ※実行に必要な他のノードがあれば、 そちらも自動的に実行される ノードのステータスが表示 32
  • 33.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | データベース ユーザースキーマ Oracle Data Minerの各概念の関係 33 プロジェクト ワークフロー ワークフロー プロジェクト ワークフロー ユーザースキーマ プロジェクト ワークフロー ワークフロー ノード ノード ノード ノード ノード ノード ノード ノード ノード ノード ノード ノード ノード ノード 1つのユーザースキーマで複数 のプロジェクトを利用可能 ノード間を接続して フローを記述 一つのプロジェクトに複数の ワークフローを作成可能 ノード ノード ノード
  • 34.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | DEMO For Oracle Data Miner 34
  • 35.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 35 環境価格 1時間 $6.720 ≒ 800円 Oracle Database Cloud Service + Oracle Advanced Analytics (Oracle Data Mining) Oracle Application Express Oracle REST Data Services Data Miner GUI Oracle SQL Developer https:// Mobiles $6.720 / hour
  • 36.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | オラクルRテクノロジー 36
  • 37.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | OracleにおけるRテクノロジー • オラクルは, 統計分析や高度な分析, 高機能グラフの生成をサポートする 言語および環境としてRを採用 • オラクルはR consortiumの創設メンバー – RIOT 2016のオーガナイザー • オラクルは次の4つのキーテクノロジーを通じてRの統合を提供 – Oracle R Distribution – ROracle – Oracle R Enterprise (ORE) – Oracle R Advanced Analytics for Hadoop (ORAAH) 37
  • 38.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Oracle R Distribution • オラクルがサポートするオープンソースRのディストリビューション • 無料でダウンロード可能 • MKL, ACML, Solaris Sun Performance Libraryを動的にロードできる 機能拡張がされている • Oracle Advanced Analytics, Oracle Linux, Oracle Big Data Applianceの ユーザーに対してはサポートを提供 38
  • 39.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | ROracle • オラクルが管理するオープンソースRパッケージ • OCIライブラリに基づいたDBI準拠のOracleドライバ • Oracle Databaseに接続でき, ユーザー指定のSQL文について トランザクション・レベルの制御と実行が可能 • CRANで公開されており, オラクルによってメンテナンス 39
  • 40.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Oracle R Enterprise (ORE) • Oracle Advanced Analyticsのコンポーネント • オープンソースRとOracle Databaseの統合 • データベースのパラレル処理機能やスケーラビリティを活用 • Rの処理をSQLに透過的に変換 • Rスクリプトをデータ分析サーバで実行 40
  • 41.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Oracle R Advanced Analytics for Hadoop (ORAAH) • Big Data Connectorsのコンポーネント • HDFSとMapReduceフレームワークに対してのRインターフェースを提供 • Sparkベースの分析アルゴリズムも提供 • Oracle R Enterpriseと透過的に動作 41
  • 42.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Oracle R Enterprise 42
  • 43.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 従来のRの制限 • メモリの制約 • データをメモリ上に展開しての演算処理 • 処理データ量に制限 • 大規模データの扱いには向いていない • 処理に応じて繰り返されるメモリへのデータロード • メモリ・リソースが枯渇しやすい • シングル・スレッド処理 • マルチコア環境で性能のスケーラビリティが低い 43
  • 44.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Oracle R Enterprise • データベースの機能としてRの実行環境を提供 – データフレーム上またはOracle表/View上でRを実行可能 – コマンド、コンソール、ワークスペースはRと同じものを提供 • 企業のデータベースをRで利用 – データベース内のデータに対してダイレクトかつ透過的に処理 – 大規模データセットをRで扱うことが可能 • 高いパフォーマンス – プログラミングレスで並列処理をDB内にて実行 44
  • 45.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 高パフォーマンス 45 • データ量が増えるとその差は顕著
  • 46.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Spawned R Engine Spawned R Engine Spawned R Engine Oracle R Enterprise アーキテクチャ 46 Database Server R Engine Other R packages Oracle R Enterprise packages R Client Spawned R Engine Other R packages Oracle R Enterprise packages SQL 結果 結果
  • 47.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Oracle R Enterprise コンポーネント 47 Database ServerClient SQL 結果 Operating System Oracle R Distribution Oracle R Enterprise Client Oracle DB Client Oracle R Enterprise supporting Packages Operating System Oracle R Distribution Oracle R Enterprise Server Oracle R Enterprise supporting Packages Oracle DB /w AA
  • 48.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Oracle R Enterpriseのメリット • Rコマンドからデータベース内の データを操作可能 • データの「移動」をなくす • データセキュリティ • データベースのパワーで分析 • データベース内でデータ準備 • Rオブジェクトをデータベースに保存 • モデルをデータベース内に作成 • データベース内でスコアリング • Rスクリプトをデータベースで実行 • オラクルの他サービスと連携可能 48
  • 49.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | インデータベース分析 49 従来のデータ分析 数時間, 数日, 数週間 Oracle R Enterprise 数秒, 数分, 数時間 Data Import Data Mining & Model "Scoring" Data Preparation & Transformation Data Mining & Model Building Data Preparation & Transformation Data Extraction Model "Scoring" Data Preparation Model Building Data Preparation
  • 50.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | ore.frame • ore.frameというdata.frameのサブクラス • データベーステーブルのプロキシとしてore.frameオブジェクトを利用可能 • データベース内のデータをクライアントに持ってくることなく処理可能 50 R> class(TITANIC01) [1] "ore.frame" attr(,"package") [1] "OREbase" R> colnames(TITANIC01) [1] "Class" "Sex" "Age" "Survived" "Freq" R> mean(TITANIC01$Freq) [1] 68.78125 Database Server R Engine Other R packages Oracle R Enterprise packages Client SQL 結果 ore.frame
  • 51.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Invoke in-database aggregation function R: Transparency through function overloading > aggdata <- aggregate(ONTIME_S$DEST, + by = list(ONTIME_S$DEST), + FUN = length) ONTIME_S In-db Stats Oracle SQL select DEST, count(*) from ONTIME_S group by DEST Oracle Advanced Analytics ORE Client Packages Transparency Layer > class(aggdata) [1] "ore.frame" attr(,"package") [1] "OREbase" > head(aggdata) Group.1 x 1 ABE 237 2 ABI 34 3 ABQ 1357 4 ABY 10 5 ACK 3 6 ACT 33 Oracle Distribution of R version 3.1.1 (--) -- "Sock it to Me" 51
  • 52.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 参考)サポートされるR演算子およびR関数(ORE 1.4.1, 1.5) 52 • 数学的変換: abs, sign, sqrt, ceiling, floor, trunc, cummax, cummin, cumprod, cumsum, log, loglo, log10, log2, log1p, acos, acosh, asin, asinh, atan, atanh, exp, expm1, cos, cosh, sin, sinh, tan, atan2, tanh, gamma, lgamma, digamma, trigamma, factorial, lfactorial, round, signif, pmin, pmax, zapsmall, rank, diff, besselI, besselJ, besselK, besselY • 基本統計: mean, summary, min, max, sum, any, all, median, range, IQR, fivenum, mad, quantile, sd, var, table, tabulate, rowSums, colSums, rowMeans, colMeans, cor, cov • 算術演算子: +, -, *, /, ^, %%, %/% • 比較演算子: ==, >, <, !=, <=, >= • 論理演算子: &, |, xor • 集合演算子: unique, %in%, subset • 文字列演算: tolower, toupper, casefold, toString, chartr, sub, gsub, substr, substring, paste, nchar, grepl • データ・フレームの結合: cbind, rbind, merge • ベクトルの結合: append • ベクトルの作成: ifelse • サブセットの選択: [, [[, $, head, tail, window, subset, Filter, na.omit, na.exclude, complete.cases • サブセットの置換: [<-, [[<-, $<- • データの再編成: split, unlist • データ処理: eval, with, within, transform • applyのバリアント: tapply, aggregate, by • 特別な値のチェック: is.na, is.finite, is.infinite, is.nan • メタデータ関数: nrow, NROW, ncol, NCOL, nlevels, names, names<-, row, col, dimnames, dimnames<-, dim, length, row.names, row.names<-, rownames, rownames<-, colnames, levels, reorder • グラフィック: arrows, boxplot, cdplot, co.intervals, coplot, hist, identify, lines, matlines, matplot, matpoints, pairs, plot, points, polygon, polypath, rug, segments, smoothScatter, sunflowerplot, symbols, text, xspline, xy.coords • 変換関数: as.logical, as.integer, as.numeric, as.character, as.vector, as.factor, as.data.frame • 型チェック関数: is.logical, is.integer, is.numeric, is.character, is.vector, is.factor, is.data.frame • 文字の操作: nchar, tolower, toupper, casefold, chartr, sub, gsub, substr • その他のore.frame関数: data.frame, max.col, scale • 仮説検定: binom.test, chisq.test, ks.test, prop.test, t.test, var.test, wilcox.test • 各種分布: 密度, 累積分布, および標準分布のクォンタイル関数 • ore.matrix関数: show, is.matrix, as.matrix, %*% (マトリクスの乗算), t, crossprod (マトリクスのクロス積), tcrossprod (BをA回転置したマトリクスのクロ ス積), solve (反転), backsolve, forwardsolve, すべての適切な算術関数(abs, sign など), summary (max, min, allなど), mean
  • 53.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | ore.pull • ore.pull関数でDB上のデータを取得しRのdata.frameに強制Cast • データをDBからクライアントに持ってきて, 処理を実行 • 処理オフロードはされないが, 既存Rスクリプトをそのまま使用可能 53 R> df_titanic <- ore.pull(TITANIC01) R> class(df_titanic) [1] "data.frame" Database Server R Engine Other R packages Oracle R Enterprise packages Client ore.pull データ data.frame
  • 54.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | ore.push • ore.push関数でデータベースに一時オブジェクトとしてRオブジェクトを格納 • データをクライアントからDBに格納し, 処理を実行 • セッションクローズ後にも保存する際には、ore.save関数を利用 54 R> v <- ore.push(c(1,2,3,4,5)) R> class(v) [1] "ore.numeric" attr(,"package") [1] "OREbase" R> head(v) [1] 1 2 3 4 5 R> ore.save(v,name="ds_1") Database Server R Engine Other R packages Oracle R Enterprise packages Client ore.push データ data.object
  • 55.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | モデル構築とスコアリング • 2種類のカテゴリが存在 – Oracle R Enterprise models(OREmodels package) • linear regression, generalized linear model, neural network, random forest classification, stepwise linear regression – Oracle Data Mining models(OREdm package) • minimum description length, apriori, decision tree, generalized linear models, k-means, naive bayes, non-negative matrix factorization, orthogonal partitioning cluster (O-Cluster), support vector machines • ore.frameオブジェクトに対して, ore.predictでスコアリング可能 – 対応しているモデル・オブジェクトであれば, OREmodels, OREdm以外にも使用可能 55
  • 56.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Invoke ORE custom parallel distributed model (Linear Regression) R: Scalable Machine Learning Models > options(ore.parallel=4) > lm_mod <- ore.lm(ARRDELAY ~ DISTANCE + DEPDELAY, data=ONTIME_S) Oracle Advanced Analytics ORE Client Packages Transparency Layer extproc extproc extproc extproc 3 2 ONTIME_S Parallel ORE Framework 1 > summary(lm_mod) Call: ore.lm(formula = ARRDELAY ~ DISTANCE + DEPDELAY, data = ONTIME_S) Residuals: Min 1Q Median 3Q Max -1462.45 -6.97 -1.36 5.07 925.08 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.254e-01 5.197e-02 4.336 1.45e-05 *** DISTANCE -1.218e-03 5.803e-05 -20.979 < 2e-16 *** DEPDELAY 9.625e-01 1.151e-03 836.289 < 2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 14.73 on 215144 degrees of freedom (4785 observations deleted due to missingness) Multiple R-squared: 0.7647, Adjusted R-squared: 0.7647 F-statistic: 3.497e+05 on 2 and 215144 DF, p-value: < 2.2e-16 56 Oracle Distribution of R version 3.1.1 (--) -- "Sock it to Me" Oracle R Distribution Parallel ore.lm Compute R Packages Oracle R Distribution Parallel ore.lm Compute R Packages Oracle R Distribution Parallel ore.lm Compute R Packages 4 Oracle R Distribution Parallel Compute Engine
  • 57.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Invoke in-database Data Mining model (Support Vector Machine) R: Scalable Machine Learning Models > svm_mod <- ore.odmSVM(BUY~INCOME+YRS_CUST+MARITAL_STATUS, data=CUST,"classification") CUST In-db Mining Model Oracle PL/SQL BEGIN DBMS_DATA_MINING.CREATE_MODEL( model_name => ’SVM_MOD’, mining_function => dbms_data_mining.classification ... Oracle Advanced Analytics ORE Client Packages Transparency Layer > summary(svm_mod) Call: ore.odmSVM(formula = BUY ~ INCOME + YRS_CUST + MARITAL_STATUS, data = CUST, type = "classification", kernel.function = "linear") Settings: value prep.auto on active.learning al.enable complexity.factor 46.044899 conv.tolerance 1e-04 kernel.function linear Coefficients: class variable value estimate 1 0 INCOME 5.204561e-05 2 0 MARITAL_STATUS M -4.531359e-05 3 0 MARITAL_STATUS S 4.531359e-05 4 0 YRS_CUST 1.264948e-04 5 0 (Intercept) 9.999269e-01 6 1 INCOME 2.032340e-05 7 1 MARITAL_STATUS M 2.636552e-06 8 1 MARITAL_STATUS S -2.636555e-06 9 1 YRS_CUST -1.588211e-04 10 1 (Intercept) -9.999324e-01 57 Oracle Distribution of R version 3.1.1 (--) -- "Sock it to Me"
  • 58.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 参考)ORE関数 > unique(apropos("^ore")) [1] "ore.attach" "ore.connect" "ore.const" "ore.corr" [5] "ore.create" "ore.crosstab" "ore.datastore" "ore.datastoreSummary" [9] "ore.delete" "ore.detach" "ore.disconnect" "ore.doEval" [13] "ore.drop" "ore.esm" "ore.exec" "ore.exists" [17] "ore.frame" "ore.freq" "ore.get" "ore.getXlevels" [21] "ore.getXnlevels" "ore.glm" "ore.glm.control" "ore.groupApply" [25] "ore.hash" "ore.hiveOptions" "ore.hour" "ore.indexApply" [29] "ore.is.connected" "ore.lazyLoad" "ore.lm" "ore.load" [33] "ore.ls" "ore.make.names" "ore.mday" "ore.minute" [37] "ore.month" "ore.neural" "ore.odmAI" "ore.odmAssocRules" [41] "ore.odmDT" "ore.odmGLM" "ore.odmKMeans" "ore.odmNB" [45] "ore.odmNMF" "ore.odmOC" "ore.odmSVM" "ore.predict" [49] "ore.pull" "ore.push" "ore.rank" "ore.recode" [53] "ore.rm" "ore.rollmax" "ore.rollmean" "ore.rollmin" [57] "ore.rollsd" "ore.rollsum" "ore.rollvar" "ore.rowApply" [61] "ore.save" "ore.scriptCreate" "ore.scriptDrop" "ore.second" [65] "OREShowDoc" "ore.showHiveOptions" "ore.sort" "ore.stepwise" [69] "ore.summary" "ore.sync" "ore.tableApply" "ore.toXML" [73] "ore.univariate" "ore.year" 58
  • 59.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 埋込み(Embeded)R • データベース側にスクリプトや関数を送り込み, データベースで実行 • データベースサーバ内で外部プロシージャ形式でRが起動 – DBサーバにRパッケージを追加することで様々なパッケージに対応 • データを分割し, 複数のRプロセスを起動し並列処理可能 59 Database Server R Engine Other R packages Oracle R Enterprise packages Client 結果 exec R script Spawned R EngineSpawned R EngineRプロシージャ Spawned R Engine Other R packages Oracle R Enterprise packages 結果
  • 60.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Server execution of open-source R package: Embedded R with ore.tableApply() R: Embedded R for using open-source R Packages > mod_biglm <- ore.tableApply(dat = ONTIME_S, # Database table function(dat) { library(biglm) # Load open-source package biglm(ARRDELAY ~ DISTANCE + DEPDELAY, dat) }); Oracle Advanced Analytics ORE Client Packages Embedded R extproc 3 2 ONTIME_S Embedded R ORE Framework 1 > library(biglm) # Load open-source package locally to interpret results > summary(mod_biglm) # Summary of the resulting Model Large data regression model: biglm(ARRDELAY ~ DISTANCE + DEPDELAY, dat) Sample size = 392805 Coef (95% CI) SE p (Intercept) 0.0638 -0.7418 0.8693 0.4028 0.8742 DISTANCE -0.0014 -0.0021 -0.0006 0.0004 0.0002 DEPDELAY 1.0552 1.0373 1.0731 0.0090 0.0000 60 Oracle Distribution of R version 3.1.1 (--) -- "Sock it to Me" Oracle R Distribution Open-source R Packages 4
  • 61.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | Server execution of open-source R package: Embedded R + parallel group-by ore.groupApply() R: Embedded R for using open-source R Packages > options(ore.parallel=4) > modList <- ore.groupApply(dat = ONTIME_S, # Database table INDEX = ONTIME_S$DEST,# groupby col function(dat) { library(biglm) # Load open-source package biglm(ARRDELAY ~ DISTANCE + DEPDELAY, dat) }); > library(biglm) # Load open-source package locally to interpret results > summary(modList) # Checks how many models we have in the model list Length Class Mode 325 ore.list S4 > summary(modList$BOS) # Request the resulting Model for Boston Logan Airport Large data regression model: biglm(ARRDELAY ~ DISTANCE + DEPDELAY, dat) Sample size = 3928 Coef (95% CI) SE p (Intercept) 0.0638 -0.7418 0.8693 0.4028 0.8742 DISTANCE -0.0014 -0.0021 -0.0006 0.0004 0.0002 DEPDELAY 1.0552 1.0373 1.0731 0.0090 0.0000 Oracle Distribution of R version 3.1.1 (--) -- "Sock it to Me" Oracle Advanced Analytics ORE Client Packages Transparency Layer extproc extproc extproc extproc 3 2 ONTIME_S Parallel ORE Framework 1 61 Oracle R Distribution Open-source R Packages R Packages Oracle R Distribution Open-source R Packages R Packages Oracle R Distribution Open-source R Packages R Packages 4 Oracle R Distribution Open-source R Packages
  • 62.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 62 環境価格 1時間 $6.720 ≒ 800円 Oracle Application Express Oracle REST Data Services Oracle R Distribution https:// Mobiles $6.720 / hour Oracle Database Cloud Service + Oracle Advanced Analytics (Oracle R Enterprise)
  • 63.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 63 オラクル・マシン・ラーニング・コンセプト Hadoop Relational Algorithms Common core, parallel, distributed SQL RGUI Cloud
  • 64.
    Copyright © 2016,Oracle and/or its affiliates. All rights reserved. | 64

Editor's Notes

  • #12 12.1では Decision Trees Naive Bayes Minimum Description Length Expectation Maximization はパラレル実行をサポート
  • #17 説明 目的変数(関数)
  • #18 予測?分析? 用途:スパム(ベイジアンフィルター)、Recomend、顔認識⇒身近なものを具体的に
  • #31 The enterprise edition of the Oracle Database includes the following database features that support Oracle Data Miner:   Oracle Data Mining  A component of the Oracle Advanced Analytics option to Oracle Database Enterprise Edition; Oracle Data Mining provides the model building, testing, and scoring capabilities for Data Miner.   Oracle XML DB  This database provides services to manage the Data Miner Repository metadata, such as the details of the workflow specifications.   Oracle Scheduler  This component provides the engine for scheduling the Data Miner workflows.   Oracle Text  This feature provides services necessary to support Text Mining.
  • #33 Validatesを選択することによって、そのノードが単体で実行可能か確認することができる
  • #34 ワークフローをエクスポートして、同ユーザースキーマ内の別のプロジェクト内や別ユーザースキーマのプロジェクトにインポートすることができる エクスポートする場合は、リポジトリファイルをxml形式でローカルで保存する
  • #38 R consortiumはR FoundationとR Communityと協力し, サポートすること
  • #39 RのライセンスはGPL2 => Oracle R Distribution MKLのライセンスが必要 Intel Math Kernel Library (MKL), AMD Core Math Library (ACML), Solaris Sun Performance Library on Solaris. Intel MKLはIntelの数学演算高速化のライブラリ ※MKLはサポート無しの無償コミュニティライセンスがあります。 ※サポートが必要な場合は別途ご購入ください Linuxの場合, LD_LIBRARY_PATHにMKLのライブラリを追加するだけです Windowsの場合 libOrdBlasLoader.dllおよびmkl_rt.dllの場所をPATHシステム環境に追加 DBサーバ(Linux/Windows)ではMKLがORACLE_HOME/lib以下に同梱されています
  • #48 Open R 最新バージョンは対応していない可能性あり (/w shared lib,lapack..)※ ClientのOSは64bitである必要あり パッケージの選択は慎重に。<-テスト環境用意を推奨