LoginSignup
7
1

More than 1 year has passed since last update.

Teradata Vantage - Vantage Analytics Library[2022/9/22時点]の翻訳です。
(リリース番号 : 2.1.1 | リリース日 : January 2022)

この記事はVantageアナリティクスライブラリ シリーズのコンテンツです。

概要

統計分析、値分析、頻度分析、ヒストグラム分析を一括で実行します。
出力結果はテーブルに出力されます。
出力テーブル名を指定する事も可能です。
指定しなければデフォルトで次の名前でテーブルが作成されます。

結果テーブル名 分析結果
TwmExploreValues 値分析
TwmExploreStatistics 統計分析
TwmExploreHistogram ヒストグラム分析
TwmExploreFrequency 頻度分析

前提条件

・Teradata Vantageインスタンスにアクセスできること。
・Vantage アナリティクス・ライブラリがインストールされていること。

Vantage アナリティクス・ライブラリのインストールについて、既にVantageを導入頂いているお客様はTeradataサポートサービスにお問い合わせください。
Vantage Express (評価版)やクラウドサービスのDIYでご利用頂く場合はTeradata Dounloadからダウンロードし利用可能です。
Vantage アナリティクス・ライブラリのインストール手順は「Vantageアナリティクス・ライブラリのインストール」の記事に従い行います。

データの準備

サンプルデータの入手とデータベースへの格納方法

こちらの「チュートリアル用のサンプルデータを用意する」を参照ください。

実行方法

SQLから実行する場合の例

CALL td_analyze (
  'dataexplorer',                           /* 分析手法 */
  '
  database        = QID;                    /* データベース名 */
  tablename       = Superstore;             /* テーブル名 */
  columns         = Category,Profit;        /* カラムリスト */
  outputdatabase  = QID;                    /* 出力データベース名 */
  '
);

出力結果

ヒストグラム分析

TwmExploreHistogram
select * from TwmExploreHistogram;
xdb xtbl xcol xbin xbeg xend xcnt xpct
QID Superstore Profit 1 -6599.978 -5099.9826 1 0.010006003602161296
QID Superstore Profit 2 -5099.9826 -3599.9871999999996 2 0.020012007204322592
QID Superstore Profit 3 -3599.9871999999996 -2099.9918 4 0.040024014408645184
QID Superstore Profit 4 -2099.9918 -599.9963999999994 34 0.3402041224734841
QID Superstore Profit 5 -599.9963999999994 899.9990000000007 9907 99.12947768661196
QID Superstore Profit 6 899.9990000000007 2399.994400000001 35 0.3502101260756454
QID Superstore Profit 7 2399.994400000001 3899.989800000001 5 0.05003001801080648
QID Superstore Profit 8 3899.989800000001 5399.985200000001 4 0.040024014408645184
QID Superstore Profit 9 5399.985200000001 6899.980600000002 1 0.010006003602161296
QID Superstore Profit 10 6899.980600000002 8399.976000000002 1 0.010006003602161296
カラム名 説明
xdb データベース名
xtbl テーブル名
xcol カラム名
xbin ビン番号
xbeg ビンの開始境界
xend ビンの終了境界
xcnt レコード数
xpct 値の割合

統計分析

TwmExploreStatistics
select * from TwmExploreStatistics;
xdb xtbl xcol xcnt xmin xmax xmean xstd
QID Superstore Profit 9994 -6599.978 8399.976 28.65689630778469 234.24838736035878
カラム名 説明
xdb データベース名
xtbl テーブル名
xcol カラム名
xcnt レコード数
xmin 値の最小値
xmax 値の最大値
xmean 値の算術平均
xstd 値の標準偏差

値分析

TwmExploreValues
select * from TwmExploreValues;
xdb xtbl xcol xtype xcnt xnull xunique xblank xzero xpos xneg
QID Superstore Profit FLOAT 9994 0 65 8058 1871
QID Superstore Category VARCHAR(128) CHARACTER SET UNICODE 9994 0 0
カラム名 説明
xdb データベース名
xtbl テーブル名
xcol カラム名
xtype データタイプ
xcnt レコード数
xnull 値がnullの数
xunique 値のユニーク数
xblank 値が空白の数
xzero 値が0の数
xpos 値が正の値の数
xneg 値が負の値の数

頻度分析

TwmExploreFrequency
select * from TwmExploreFrequency;
xdb xtbl xcol xval xcnt xpct
QID Superstore Category Office Supplies 6026 60.29617770662397
QID Superstore Category Technology 1847 18.481088653191915
QID Superstore Category Furniture 2121 21.22273364018411
カラム名 説明
xdb データベース名
xtbl テーブル名
xcol カラム名
xval
xcnt レコード数
xpct 値の割合

おわりに

サンプルコードはSQL関数から掲載し順次Pythonコードも掲載していく予定です。

警告
この本書はTeradata Vantageドキュメンテーションよりトピックに必要な情報を抜粋したものです。掲載内容の正確性・完全性・信頼性・最新性を保証するものではございません。正確な内容については、原本をご参照下さい。
また、修正が必要な箇所や、ご要望についてはコメントをよろしくお願いします。

Teradata Vantageへのお問合せ

Teradata Vantage へのお問合せ

7
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
1