Recently, I worked on a cybersecurity project that entailed processing a staggering number of raw text files about web traffic. Millions of rows had to be read and parsed to extract variable values. The problem was complicated by the varying records composition. Each external raw file was a collection of
Tag: Developers
Whether you’re applying for your first credit card or shopping for a second home – or anywhere in between – you’ll probably encounter an application process. As part of that process, banks and other lenders use a scorecard to determine your likelihood to pay off that loan. Naturally, this means
SAS supports direct integration for Git from Base SAS (via functions), SAS Enterprise Guide, SAS Studio, and SAS Data Integration Studio. Read this article to learn how to use Git more effectively in your SAS processes.
My New Year's resolution: “Unclutter your life” and I hope this post will help you do the same. Here I share with you a data preparation approach and SAS coding technique that will significantly simplify, unclutter and streamline your SAS programming life by using data templates. Dictionary.com defines template as
Numbers don't lie, but sometimes they don't reveal the full story. Last week I wrote about the most popular articles from The DO Loop in 2018. The popular articles are inevitably about elementary topics in SAS programming or statistics because those topics have broad appeal. However, I also write about
Last year, I wrote more than 100 posts for The DO Loop blog. Of these, the most popular articles were about data visualization, SAS programming tips, and statistical data analysis. Here are the most popular articles from 2018 in each category. Data Visualization Visualize repetition in song lyrics: In one
This post rounds out the year and my series of articles on SAS REST APIs. You can read all of my posts on this topic here. The first two articles in the series: Using SAS Viya REST APIs to access images from SAS Visual Analytics and Using SAS Cloud Analytics
Find out about this new set of tools designed to be used in conjunction with the sas-admin command line interfaces.
PythonからSAS Viyaの機能を利用するための基本パッケージであるSWATと、よりハイレベルなPython向けAPIパッケージであるDLPyを使用して、Jupyter NotebookからPythonでSAS Viyaの機能を使用して一般物体検出(Object Detection)を試してみました。 今回は、弊社で用意した数枚の画像データを使用して、処理の流れを確認するだけなので、精度に関しては度外視です。 大まかな処理の流れは以下の通りです。 1.必要なパッケージ(ライブラリ)のインポートとセッションの作成 2.一般物体検出向け学習用データの作成 3.モデル構造の定義 4.モデル生成(学習) 5.物体検出(スコアリング) 1.必要なパッケージ(ライブラリ)のインポートとセッションの作成 swatやdlpyなど、必要なパッケージをインポートします。 from swat import * import sys sys.path.append(dlpy_path) from dlpy.model import * from dlpy.layers import * from dlpy.applications import * from dlpy.utils import * from dlpy.images import ImageTable from dlpy.splitting import two_way_split from dlpy.blocks import *
Disclaimer: this article does not cover or promote any political views. It’s all about data and REST APIs. I am relieved, thankful, elated, glad, thrilled, joyful (I could go on with more synonyms from my thesaurus.com search for 'happy') November 6, 2018 has come and gone. Election day is over.
This blog post outlines how to create your own CAS functions using the CAS Language. It also includes a partial list of both CASL built-in and common functions for reference.
You can communicate with various clients (SAS, Python, Lua, Java, and REST) in the same place using SAS® Cloud Base Analytics Services (CAS) in SAS Viya. But before you can do any analysis in CAS you need some data to work with, and a way to get to it. Check out this dynamic data selection tip using SAS Viya and Python.
In their new book, SAS Viya: the R Perspective, Kevin Smith and Xiangxiang Meng provide an overview of using R with the SAS Viya platform. Read on to see how R programmers can use CAS.
SASでは、従来からオープン・AIプラットフォームであるSAS Viyaの機能をPythonから効率的に活用いただくためのハイレベルなPython向けAPIパッケージであるDLPyを提供してきました。 従来のDLPyは、Viya3.3以降のディープラーニング(CNN)と画像処理(image action set)のために作成された、Python API向けハイレベルパッケージです。 DLPyではKerasに似たAPIを提供し、より簡潔なコーディングで高度な画像処理やCNNモデリングが可能でした。 そして、この度、このDLPyが大幅に機能拡張されました。 最新版DLPy1.0では、以下の機能が拡張されています。 ■ 従来からの画像データに加え、テキスト、オーディオ、そして時系列データを解析可能 ■ 新たなAPIの提供: ・ RNN に基づくタスク: テキスト分類、テキスト生成、そして 系列ラベリング(sequence labeling) ・ 一般物体検出(Object Detection) ・ 時系列処理とモデリング ・ オーディオファイルの処理と音声認識モデル生成 ■ 事前定義ネットワーク(DenseNet, DarkNet, Inception, and Yolo)の追加 ■ データビジュアライゼーションとメタデータハンドリングの拡張 今回はこれらの拡張機能の中から「一般物体検出(Object Detection)」機能を覗いてみましょう。 SAS Viyaでは従来から画像分類(資料画像1.の左から2番目:Classification)は可能でした。例えば、画像に映っている物体が「猫」なのか「犬」なのかを認識・分類するものです。 これに加えて、DLPy1.0では、一般物体検出(資料画像1.の左から3番目:Object Detection)が可能になりました。 資料画像1. (引用:Fei-Fei Li & Justin Johnson & Serena Yeung’s Lecture
This article is the first in a series of three publications covering REST APIs and their use in, and with SAS. Today, I want to cover a basic example using SAS Viya REST APIs to download an image from a report in SAS Visual Analytics.
In addition to the many CAS actions supplied by SAS, as of SAS® Viya™ 3.4, you can create your own actions using CASL. Learn how in this post.
近年、クラウドファーストを唱える企業が増加し、データ分析のために、クラウド上に展開されている分析サービスを活用したり、クラウド上に独自に分析アプリケーションを構築するケースも増えています。 しかし、クラウド上にある分析サービスやアプリケーションで分析する対象のデータは、オンプレミス上に蓄積されているケースが大半であり、クラウドからこれらのデータにアクセスできるようにするための作業や環境設定は面倒かつ非効率で、膨大なデータをクラウドとやり取りするなどの運用コストも大きく、かつセキュリティのリスク回避も考慮しなければなりません。 こうした課題を解決するために、SAS ViyaではSAS Cloud Data Exchange (CDE)を提供しています。 SAS Cloud Data Exchange (CDE) は、プライベート/パプリックのクラウド上にあるアプリケーション(=SAS Viya)からファイヤーウォールの後ろにある、顧客のオンプレミス上にあるデータに安全かつ確実にアクセスし、大量のデータをクラウドへ高速に転送することを可能とするデータ接続機能です。 CDEは、SAS Viyaのセルフサービス・データ準備向け製品であるSAS Data Preparationに含まれる機能です。 CDEを使用すれば、クラウド上にあるSAS Viyaからオンプレミス上にある様々なデータソース(Oracle, Teradata, Hadoop etc.)へ最小限の手順で容易かつセキュアにアクセスすることが可能になります。 サポート対象データソース: ・DB2, ODBC, Apache Hive, Oracle, Redshift, SQL Server, Postgres, SAP HANA, Teradata, SAS Data Sets CDEでは、最小限の一つのポート(Https port)を使用し、オンプレミス上にあるデータソースにアクセスするための資格情報(ユーザーID /パスワード)も保護された領域に格納し、使用するため、安全性が高められています。 また、クラウド上のSAS Viyaが複数のワーカーノードで分散構成されている場合には、オンプレミス上のデータを並列で高速にSAS Viya環境へロードすることが可能です。 利用手順概要は以下の通りです。 オンプレミス側にSAS Data Agent
Data in the cloud makes it easily accessible, and can help businesses run more smoothly. SAS Viya runs its calculations on Cloud Analytics Service (CAS). David Shannon of Amadeus Software spoke at SAS Global Forum 2018 on his paper, Come On, Baby, Light my SAS Viya: Programming for CAS.
SAS Viya has opened an entirely new set of capabilities, allowing SAS to analyze on cloud technology in real-time. One of the best new features of SAS Viya is its ability to pair with open source platforms, allowing developers the freedom of language and implementation to integrate with the power
Getting started with SAS Viya and RStudio -- making the connection, and submitting my first commands via CAS actions.
SASでは、従来からSAS Viyaの機能をPythonなど各種汎用プログラミング言語から利用するためのパッケージであるSWATを提供していました。 これに加え、よりハイレベルなPython向けAPIパッケージであるDLPyの提供も開始され、PythonからViyaの機能をより効率的に活用することが可能となっています。 ※DLPyの詳細に関しては以下サイトをご覧ください。 https://github.com/sassoftware/python-dlpy DLPyとは DLPyの機能(一部抜粋) 1.DLPyとは DLPyは、Viya3.3以降のディープラーニングと画像処理(image action set)のために作成された、Python API向けハイレベルパッケージです。DLPyではKerasに似たAPIを提供し、ディープラーニングと画像処理のコーディングの効率化が図られています。既存のKerasのコードをほんの少し書き換えるだけで、SAS Viya上でその処理を実行させることも可能になります。 例えば、以下はCNNの層の定義例です。Kerasに酷似していることがわかります。 DLPyでサポートしているレイヤは、InputLayer, Conv2d, Pooling, Dense, Recurrent, BN, Res, Proj, OutputLayer、です。 以下は学習時の記述例です。 2.DLPyの機能(一部抜粋) 複数のイルカとキリンの画像をCNNによって学習し、そのモデルにテスト画像を当てはめて予測する内容を例に、DLPyの機能(一部抜粋)を紹介します。 2-1.メジャーなディープラーニング・ネットワークの実装 DLPyでは、事前に構築された以下のディープラーニングモデルを提供しています。 VGG11/13/16/19、 ResNet34/50/101/152、 wide_resnet、 dense_net また、以下のモデルでは、ImageNetのデータを使用した事前学習済みのweightsも提供(このweightsは転移学習によって独自のタスクに利用可能)しています。 VGG16、VGG19、ResNet50、ResNet101、ResNet152 以下は、ResNet50の事前学習済みのweightsを転移している例です。 2-2.CNNの判断根拠情報 heat_map_analysis()メソッドを使用し、画像の何処に着目したのかをカラフルなヒートマップとして出力し、確認することができます。 また、get_feature_maps()メソッドを使用し、CNNの各層の特徴マップ(feature map)を取得し、feature_maps.display()メソッドを使用し、取得されたfeature mapの層を指定して表示し、確認することもできます。 以下は、レイヤー1のfeature mapの出力結果です。 以下は、レイヤー18のfeature mapの出力結果です。 2-3.ディープラーニング&画像処理関連タスク支援機能 2-3-1.resize()メソッド:画像データのリサイズ 2-3-2.as_patches()メソッド:画像データ拡張(元画像からパッチを生成) 2-3-3.two_way_split()メソッド:データ分割(学習、テスト) 2-3-4.plot_network()メソッド:定義したディープラーニングの層(ネットワーク)の構造をグラフィカルな図として描画 2-3-5.plot_training_history()メソッド:反復学習の履歴表示
With SAS Viya 3.3, a new data transfer mechanism Multi Node Data Transfer has been introduced to transfer data between the data source and the SAS’ Cloud Analytics Services. Learn more about this feature.
SAS Viya 3.3 introduced a set of command-line interfaces that SAS Viya administrators will find extremely useful. The command-line interfaces(CLI) will allow administrators to perform numerous administrative tasks in batch as an alternative to using the SAS Environment Manager interface. In addition, calls to the CLI’s can be chained together
The R SWAT package (SAS Wrapper for Analytics Transfer) enables you to upload big data into an in-memory distributed environment to manage data and create predictive models using familiar R syntax. In the SAS Viya Integration with Open Source Languages: R course, you learn the syntax and methodology required to
In this article, I will set out clear principles for how SAS Viya 3.3 will interoperate with Kerberos. My aim is to present some overview concepts for how we can use Kerberos authentication with SAS Viya 3.3. We will look at both SAS Viya 3.3 clients and SAS 9.4M5 clients.
This article and accompanying technical white paper are written to help SAS 9 users process existing SAS 9 code multi-threaded in SAS Viya 3.3. Read the full paper, Getting Your SAS 9 Code to Run Multi-Threaded in SAS Viya 3.3. The Future is Multi-threaded Processing Using SAS® Viya® When I first began
In this article, I want to give you an overview of the authentication options available with SAS Viya 3.3. SAS Viya 3.3, released in the second week of December 2017, and the second release with the new microservices architecture, presents more options for authentication than the previous releases. In future
I've used SAS with a bunch of different REST APIs: GitHub, Brightcove, Google Analytics, Lithium, LinkedIn, and more. For most of these I have to send user/password or "secret" application tokens to the web service so that it knows who I am and what data I can retrieve. I do
The SAS® platform is now open to be accessed from open-source clients such as Python, Lua, Java, the R language, and REST APIs to leverage the capabilities of SAS® Viya® products and solutions. You can analyze your data in a cloud-enabled environment that handles large amounts of data in a
SAS Viyaがリニューアルされまして、ついにディープラーニングが登場しました! SAS ViyaのディープラーニングではオーソドックスなDeep Neural Network(DNN)から、画像認識で使われるConvolutional Neural Network(CNN、畳込みニューラルネットワーク)、連続値や自然言語処理で使われるRecurrent Neural Network(RNN、再帰的ニューラルネットワーク)まで利用可能になります。 ディープラーニングを使うことのメリットは、従来の機械学習やニューラルネットワークが苦手としている画像や文章を認識し、高い精度で分類や推論することが可能になります。 高い精度というのは、ディープラーニングのモデルによっては人間の目よりも正確に画像を分類することができるということです。 例えばコモンドールという犬種がありますが、この犬はモップのような毛並みをしていて、人間ではモップと見間違えることがあります。 これは犬? それともモップ? こういう人間だと見分けにくい画像に対しても、ディープラーニングであれば、人間よりも正確に犬かモップかを見分けることができるようになります。 というわけで、今回はSAS Viyaのディープラーニングを使って画像分類をしてみたいと思います。 ディープラーニングの仕組み 画像分類のディープラーニングではCNNを使います。 CNNは画像の特徴を探し出す特徴抽出層と特徴から画像を分類する判定層で構成されています。 特徴抽出層は主に畳込み層とプーリング層で構成されています。 畳込み層で入力画像に対し、ピクセルの特徴(横線の有無とか斜め線とか)を探し出し、プーリング層で重要なピクセルを残す、という役割分担です。 判定層は、特徴抽出層が見つけた特徴をもとに、画像の種類を分類します。 例えば犬と猫の分類であれば、特徴抽出層が入力画像から、面長で大きな鼻の特徴を見つけだし、犬と分類します。 または、丸っこい顔立ちと立った耳の特徴を見つけだし、猫と分類します。 SAS Viyaで画像を扱う SAS ViyaディープラーニングでCifar10をネタに画像分類をしてみたいと思います。 Cifar10は無償で公開されている画像分類のデータセットで、10種類の色付き画像60,000枚で構成されています。 各画像サイズは32×32で、色はRGBです。 10種類というのは飛行機(airplane)、自動車(automobile)、鳥(bird)、猫(cat)、鹿(deer)、犬(dog)、蛙(frog)、馬(horse)、船(ship)、トラック(truck)で、それぞれ6,000枚ずつ用意されています。 画像は総数60,000枚のうち、50,000枚がトレーニング用、10,000枚がテスト用です。 画像データは以下から入手することができます。 https://www.cs.toronto.edu/~kriz/cifar.html さて、Cifar10を使って画像分類をしてみます。言語はPython3を使います。 SAS Viyaで画像分類をする場合、まずは入手したデータをCASにアップロードする必要があります。 CASはCloud Analytics Servicesの略称で、インメモリの分散分析基盤であり、SAS Viyaの脳みそにあたる部分です。 SAS Viyaの分析は、ディープラーニング含めてすべてCASで処理されます。 CASではImage型のデータを扱うことができます。 Image型とは読んで字のごとくで、画像を画像フォーマットそのままのバイナリで扱えるということです。