Top Banner
Copyright © SAS Institute Inc. All rights reserved. I am Multilingual Python / Rで使うSAS ViyaSAS Institute Japan株式会社 SUPER DEMO
34

Python / R で使うSAS Viya

Jan 23, 2018

Download

Data & Analytics

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

I am Multilingual~Python / Rで使うSAS Viya~SAS Institute Japan株式会社

SUPER DEMO

Page 2: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

Para

llel &

Ser

ial,

Pub

/ S

ub

, W

eb S

ervi

ces,

MQ

s

Source-basedEngines

Microservices

UAA

QueryGen

Folders

CAS Mgmt

Data Source Mgmt

AnalyticsGUIs

etc…

BIGUIs

EnvMgr

ModelMgmt

Log

Audit

UAAUAA

Data Mgmt GUIs

In-Memory Engine

In-Database

In-Hadoop

In-StreamSolutions

APIs

Platform

Analytics

Data ManagementFraud and Security Intelligence

Business VisualizationRisk Management

!

Customer Intelligence

Cloud Analytics Services (CAS)

GoogleCloudPlatform

What is SAS Viya?

2

Page 3: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

What can SAS Viya do?

Visual Interfaces

Programming Interfaces

API Interfaces

Microservices

UAA

QueryGen

Folders

CAS Mgmt

Data Source Mgmt

AnalyticsGUIs

etc…

BIGUIs

EnvMgr

ModelMgmt

Log

Audit

UAAUAA

Data Mgmt GUIs

In-Memory Engine

Cloud Analytics Services (CAS)

データロード

探索・加工

モデル化

スコアリング

アセスメント 3

Page 4: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

How do I use it?

Microservices

UAA

QueryGen

Folders

CAS Mgmt

Data Source Mgmt

AnalyticsGUIs

etc…

BIGUIs

EnvMgr

ModelMgmt

Log

Audit

UAAUAA

Data Mgmt GUIs

In-Memory Engine

Cloud Analytics Services (CAS)

データロード

探索・加工

モデル化

スコアリング

アセスメント

Python SWAT

R SWAT

https://github.com/sassoftware/python-swat

https://github.com/sassoftware/R-swat4

Page 5: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

What is SWAT?

1. Special Weapon and Tactics

2. SAS Scripting Wrapper for Analytics Transfer

5

Page 6: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

What is SWAT?

1. Special Weapon and Tactics

2. SAS Scripting Wrapper for Analytics Transfer

6

Page 7: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

How do I use it?

Python SWAT

pip install https://github.com/sassoftware/python-

swat/releases/download/v1.0.0/python-swat-1.0.0-linux64.tar.gz

7

Page 8: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

How do I use it?

Python SWAT

R SWAT

wget https://github.com/sassoftware/R-

swat/releases/download/v1.0.0/r-swat-1.0.0-linux64.tar.gz

R CMD INSTALL r-swat-1.0.0-linux64.tar.gz

8

Page 9: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

SWAT Supports

Linux

Windows

Mac9

Page 10: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

Now give it a try!

Microservices

UAA

QueryGen

Folders

CAS Mgmt

Data Source Mgmt

AnalyticsGUIs

etc…

BIGUIs

EnvMgr

ModelMgmt

Log

Audit

UAAUAA

Data Mgmt GUIs

In-Memory Engine

Cloud Analytics Services (CAS)

データロード

探索・加工

モデル化

スコアリング

アセスメント

Python SWAT

R SWAT

https://github.com/sassoftware/python-swat

https://github.com/sassoftware/R-swat10

Page 11: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

11

Page 12: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

Python SWATをインポートし、SAS ViyaのCASに接続します。CASとはSAS Viyaのインメモリ分析エンジンです。

12

Page 13: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

分析対象のデータをCASにロードします。今回はタイタニック号の乗船者データを使います。

13

Page 14: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

Pandas Dataframe同様の操作が可能

14

Page 15: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

Pandas Dataframe同様の操作が可能

15

Page 16: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

決定木分析でモデルを作ります。ターゲット変数は "survived" です。

16

Page 17: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

スコアリングし、モデルを評価します。

17

Page 18: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

スコアリングし、モデルを評価します。

18

Page 19: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

ランダムフォレストでモデルを作ります。

19

Page 20: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

スコアリングし、モデルを評価します。

20

Page 21: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

スコアリングし、モデルを評価します。

21

Page 22: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

ROC曲線をグラフに描画します。

22

Page 23: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

Links for Python and SAS Viya

• https://github.com/sassoftware/python-swat

• https://sassoftware.github.io/python-swat/index.html#

• https://github.com/sassoftware/sas-viya-programming

• http://go.documentation.sas.com/?cdcId=vdmmlcdc&cdcVersion=8.11&docsetId=caspg3&docsetTarget=titlepage.htm&locale=ja

23

Page 24: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

Now give it a try!

Microservices

UAA

QueryGen

Folders

CAS Mgmt

Data Source Mgmt

AnalyticsGUIs

etc…

BIGUIs

EnvMgr

ModelMgmt

Log

Audit

UAAUAA

Data Mgmt GUIs

In-Memory Engine

Cloud Analytics Services (CAS)

データロード

探索・加工

モデル化

スコアリング

アセスメント

Python SWAT

R SWAT

https://github.com/sassoftware/python-swat

https://github.com/sassoftware/R-swat24

Page 25: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

25

Page 26: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

R SWATを呼び出してCASに接続します。

26

Page 27: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

データをCASにロードします。

27

Page 28: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

データを表示します。

28

Page 29: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

決定木で分析します。

29

Page 30: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

スコアリングします。

30

Page 31: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

モデルを評価します。

31

Page 32: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

モデルの予測精度をまとめます。

32

Page 33: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

ROC曲線を描画します。

33

Page 34: Python / R で使うSAS Viya

Copyright © SAS Inst itute Inc. A l l r ights reserved.

Links for R and SAS Viya

• https://github.com/sassoftware/R-swat-

• http://go.documentation.sas.com/?cdcId=vdmmlcdc&cdcVersion=8.11&docsetId=caspg3r&docsetTarget=titlepage.htm&locale=ja

34