ほんとのこと知りたいだけなのに。

夏休みはもうおわり。

LAPACK 計算ルーチン(Computational Routines) を一覧にしてみる。

ここの配架にあるルーチンを一覧表にする。

連立一次方程式
Linear Equations

Type of matrix
and
storage scheme
Operation YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
general factorize GE TRF SGETRF CGETRF DGETRF ZGETRF
solve using factorization GE TRS SGETRS CGETRS DGETRS ZGETRS
estimate condition number GE CON SGECON CGECON DGECON ZGECON
error bounds for solution GE RFS SGERFS CGERFS DGERFS ZGERFS
invert using factorization GE TRI SGETRI CGETRI DGETRI ZGETRI
equilibrate GE EQU SGEEQU CGEEQU DGEEQU ZGEEQU
general factorize GB TRF SGBTRF CGBTRF DGBTRF ZGBTRF
band solve using factorization GB TRS SGBTRS CGBTRS DGBTRS ZGBTRS
estimate condition number GB CON SGBCON CGBCON DGBCON ZGBCON
error bounds for solution GB RFS SGBRFS CGBRFS DGBRFS ZGBRFS
equilibrate GB EQU SGBEQU CGBEQU DGBEQU ZGBEQU
general factorize GT TRF SGTTRF CGTTRF DGTTRF ZGTTRF
tridiagonal solve using factorization GT TRS SGTTRS CGTTRS DGTTRS ZGTTRS
estimate condition number GT CON SGTCON CGTCON DGTCON ZGTCON
error bounds for solution GT RFS SGTRFS CGTRFS DGTRFS ZGTRFS
symmetric/Hermitian factorize PO TRF SPOTRF CPOTRF DPOTRF ZPOTRF
positive definite solve using factorization PO TRS SPOTRS CPOTRS DPOTRS ZPOTRS
estimate condition number PO CON SPOCON CPOCON DPOCON ZPOCON
error bounds for solution PO RFS SPORFS CPORFS DPORFS ZPORFS
invert using factorization PO TRI SPOTRI CPOTRI DPOTRI ZPOTRI
equilibrate PO EQU SPOEQU CPOEQU DPOEQU ZPOEQU
symmetric/Hermitian factorize PP TRF SPPTRF CPPTRF DPPTRF ZPPTRF
positive definite solve using factorization PP TRS SPPTRS CPPTRS DPPTRS ZPPTRS
(packed storage) estimate condition number PP CON SPPCON CPPCON DPPCON ZPPCON
error bounds for solution PP RFS SPPRFS CPPRFS DPPRFS ZPPRFS
invert using factorization PP TRI SPPTRI CPPTRI DPPTRI ZPPTRI
equilibrate PP EQU SPPEQU CPPEQU DPPEQU ZPPEQU
symmetric/Hermitian factorize PB TRF SPBTRF CPBTRF DPBTRF ZPBTRF
positive definite solve using factorization PB TRS SPBTRS CPBTRS DPBTRS ZPBTRS
band estimate condition number PB CON SPBCON CPBCON DPBCON ZPBCON
error bounds for solution PB RFS SPBRFS CPBRFS DPBRFS ZPBRFS
equilibrate PB EQU SPBEQU CPBEQU DPBEQU ZPBEQU
symmetric/Hermitian factorize PT TRF SPTTRF CPTTRF DPTTRF ZPTTRF
positive definite solve using factorization PT TRS SPTTRS CPTTRS DPTTRS ZPTTRS
tridiagonal estimate condition number PT CON SPTCON CPTCON DPTCON ZPTCON
error bounds for solution PT RFS SPTRFS CPTRFS DPTRFS ZPTRFS
symmetric/Hermitian factorize HE TRF SSYTRF CHETRF DSYTRF ZHETRF
indefinite solve using factorization HE TRS SSYTRS CHETRS DSYTRS ZHETRS
estimate condition number HE CON SSYCON CHECON DSYCON ZHECON
error bounds for solution HE RFS SSYRFS CHERFS DSYRFS ZHERFS
invert using factorization HE TRI SSYTRI CHETRI DSYTRI ZHETRI
complex symmetric factorize SY TRF --- CSYTRF --- ZSYTRF
solve using factorization SY TRS --- CSYTRS --- ZSYTRS
estimate condition number SY CON --- CSYCON --- ZSYCON
error bounds for solution SY RFS --- CSYRFS --- ZSYRFS
invert using factorization SY TRI --- CSYTRI --- ZSYTRI
symmetric/Hermitian factorize HP TRF SSPTRF CHPTRF DSPTRF ZHPTRF
indefinite solve using factorization HP TRS SSPTRS CHPTRS DSPTRS ZHPTRS
(packed storage) estimate condition number HP CON SSPCON CHPCON DSPCON ZHPCON
error bounds for solution HP RFS SSPRFS CHPRFS DSPRFS ZHPRFS
invert using factorization HP TRI SSPTRI CHPTRI DSPTRI ZHPTRI
complex symmetric factorize SP TRF --- CSPTRF --- ZSPTRF
(packed storage) solve using factorization SP TRS --- CSPTRS --- ZSPTRS
estimate condition number SP CON --- CSPCON --- ZSPCON
error bounds for solution SP RFS --- CSPRFS --- ZSPRFS
invert using factorization SP TRI --- CSPTRI --- ZSPTRI
triangular solve TR TRS STRTRS CTRTRS DTRTRS ZTRTRS
estimate condition number TR CON STRCON CTRCON DTRCON ZTRCON
error bounds for solution TR RFS STRRFS CTRRFS DTRRFS ZTRRFS
invert TR TRI STRTRI CTRTRI DTRTRI ZTRTRI
triangular solve TP TRS STPTRS CTPTRS DTPTRS ZTPTRS
(packed storage) estimate condition number TP CON STPCON CTPCON DTPCON ZTPCON
error bounds for solution TP RFS STPRFS CTPRFS DTPRFS ZTPRFS
invert TP TRI STPTRI CTPTRI DTPTRI ZTPTRI
triangular solve TB TRS STBTRS CTBTRS DTBTRS ZTBTRS
band estimate condition number TB CON STBCON CTBCON DTBCON ZTBCON
error bounds for solution TB RFS STBRFS CTBRFS DTBRFS ZTBRFS

その他の因数分解
Other Factorizations

Type of matrix
and
storage scheme
Operation YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
QR, general factorize with pivoting GE QP3 SGEQP3 CGEQP3 DGEQP3 ZGEQP3
factorize, no pivoting GE QRF SGEQRF CGEQRF DGEQRF ZGEQRF
generate Q OR GQR SORGQR CUNGQR DORGQR ZUNGQR
multiply matrix by Q OR MQR SORMQR CUNMQR DORMQR ZUNMQR
LQ, general factorize, no pivoting GE LQF SGELQF CGELQF DGELQF ZGELQF
generate Q OR GLQ SORGLQ CUNGLQ DORGLQ ZUNGLQ
multiply matrix by Q OR MLQ SORMLQ CUNMLQ DORMLQ ZUNMLQ
QL, general factorize, no pivoting GE QLF SGEQLF CGEQLF DGEQLF ZGEQLF
generate Q OR GQL SORGQL CUNGQL DORGQL ZUNGQL
multiply matrix by Q OR MQL SORMQL CUNMQL DORMQL ZUNMQL
RQ, general factorize, no pivoting GE RQF SGERQF CGERQF DGERQF ZGERQF
generate Q OR GRQ SORGRQ CUNGRQ DORGRQ ZUNGRQ
multiply matrix by Q OR MRQ SORMRQ CUNMRQ DORMRQ ZUNMRQ
RZ, trapezoidal factorize, no pivoting
(blocked algorithm)
TZ RZF STZRZF CTZRZF DTZRZF ZTZRZF
multiply matrix by Q OR MRZ SORMRZ CUNMRZ DORMRZ ZUNMRZ

対称固有値問題
Symmetric Eigenproblems

Type of matrix
and
storage scheme
Operation YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
dense symmetric
(or Hermitian)
tridiagonal reduction SY TRD SSYTRD CHETRD DSYTRD ZHETRD
packed symmetric
(or Hermitian)
tridiagonal reduction SP TRD SSPTRD CHPTRD DSPTRD ZHPTRD
band symmetric
(or Hermitian)
tridiagonal reduction SB TRD SSBTRD CHBTRD DSBTRD ZHBTRD
orthogonal/unitary generate matrix after
reduction by xSYTRD
OR GTR SORGTR CUNGTR DORGTR ZUNGTR
multiply matrix after
reduction by xSYTRD
OR MTR SORMTR CUNMTR DORMTR ZUNMTR
orthogonal/unitary
(packed storage)
generate matrix after
reduction by xSPTRD
OP GTR SOPGTR CUPGTR DOPGTR ZUPGTR
multiply matrix after
reduction by xSPTRD
OP MTR SOPMTR CUPMTR DOPMTR ZUPMTR
symmetric
tridiagonal
eigenvalues/
eigenvectors via QR
ST EQR SSTEQR CSTEQR DSTEQR ZSTEQR
eigenvalues only
via root-free QR
ST ERF SSTERF --- DSTERF ---
eigenvalues/
eigenvectors via
divide and conquer
ST EDC SSTEDC CSTEDC DSTEDC ZSTEDC
eigenvalues/
eigenvectors via
RRR
ST EGR SSTEGR CSTEGR DSTEGR ZSTEGR
eigenvalues only
via bisection
ST EBZ SSTEBZ --- DSTEBZ ---
eigenvectors by
inverse iteration
ST EIN SSTEIN CSTEIN DSTEIN ZSTEIN
symmetric
tridiagonal
positive definite
eigenvalues/
eigenvectors
PT EQR SPTEQR CPTEQR DPTEQR ZPTEQR

不変部分空間と条件数
Invariant Subspaces and Condition Numbers

Type of matrix
and
storage scheme
Operation YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
general Hessenberg reduction GE HRD SGEHRD CGEHRD DGEHRD ZGEHRD
balancing GE BAL SGEBAL CGEBAL DGEBAL ZGEBAL
backtransforming GE BAK SGEBAK CGEBAK DGEBAK ZGEBAK
orthogonal/unitary generate matrix after
Hessenberg reduction
OR GHR SORGHR CUNGHR DORGHR ZUNGHR
multiply matrix after
Hessenberg reduction
OR MHR SORMHR CUNMHR DORMHR ZUNMHR
Hessenberg Schur factorization HS EQR SHSEQR CHSEQR DHSEQR ZHSEQR
eigenvectors by
inverse iteration
HS EIN SHSEIN CHSEIN DHSEIN ZHSEIN
(quasi)triangular eigenvectors TR EVC STREVC CTREVC DTREVC ZTREVC
reordering Schur
factorization
TR EXC STREXC CTREXC DTREXC ZTREXC
Sylvester equation TR SYL STRSYL CTRSYL DTRSYL ZTRSYL
condition numbers of
eigenvalues/vectors
TR SNA STRSNA CTRSNA DTRSNA ZTRSNA
condition numbers of
eigenvalue cluster/
invariant subspace
TR SEN STRSEN CTRSEN DTRSEN ZTRSEN

特異値分解
Singular Value Decomposition

Type of matrix
and
storage scheme
Operation YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
general bidiagonal reduction GE BRD SGEBRD CGEBRD DGEBRD ZGEBRD
general band bidiagonal reduction GB BRD SGBBRD CGBBRD DGBBRD ZGBBRD
orthogonal/unitary generate matrix after
bidiagonal reduction
OR GBR SORGBR CUNGBR DORGBR ZUNGBR
multiply matrix after
bidiagonal reduction
OR MBR SORMBR CUNMBR DORMBR ZUNMBR
bidiagonal SVD using
QR or dqds
BD SQR SBDSQR CBDSQR DBDSQR ZBDSQR
SVD using
divide-and-conquer
BD SDC SBDSDC --- DBDSDC ---

一般対称明確な固有値問題
Generalized Symmetric Definite Eigenproblems

Type of matrix
and
storage scheme
Operation YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
symmetric/Hermitian reduction SY GST SSYGST CHEGST DSYGST ZHEGST
symmetric/Hermitian
(packed storage)
reduction SP GST SSPGST CHPGST DSPGST ZHPGST
symmetric/Hermitian
banded
split Cholesky
factorization
PB STF SPBSTF CPBSTF DPBSTF ZPBSTF
reduction SB GST SSBGST DSBGST CHBGST ZHBGST

収縮部分空間と条件数
Deflating Subspaces and Condition Numbers

Type of matrix
and
storage scheme
Operation YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
general Hessenberg reduction GG HRD SGGHRD CGGHRD DGGHRD ZGGHRD
balancing GG BAL SGGBAL CGGBAL DGGBAL ZGGBAL
back transforming GG BAK SGGBAK CGGBAK DGGBAK ZGGBAK
Hessenberg
(quasi)triangular
Schur factorization HG EQZ SHGEQZ CHGEQZ DHGEQZ ZHGEQZ
eigenvectors TG EVC STGEVC CTGEVC DTGEVC ZTGEVC
reordering
Schur decomposition
TG EXC STGEXC CTGEXC DTGEXC ZTGEXC
Sylvester equation TG SYL STGSYL CTGSYL DTGSYL ZTGSYL
condition numbers of eigenvalues/vectors TG SNA STGSNA CTGSNA DTGSNA ZTGSNA
condition numbers of
eigenvalue cluster/
deflating subspaces
TG SEN STGSEN CTGSEN DTGSEN ZTGSEN

一般(or 商)特異値分解
Generalized (or Quotient) Singular Value Decomposition

Type of matrix
and
storage scheme
Operation YYY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
??? triangular reduction of A and B GG SVP SGGSVP CGGSVP DGGSVP ZGGSVP
??? GSVD of a pair of triangular matrices TG SJA STGSJA CTGSJA DTGSJA ZTGSJA

おわり

129個の命令があります。 なかなかな数ですね。

LAPACK ドライバルーチン(Driver routines)を一覧にしてみる。

Driver Routines 配架にある表をまとめて一つにします。

連立一次方程式 (Linear Equations)

LE

Function and storage scheme YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
general - simple driver GE SV S CGESV DGESV ZGESV
general - expert driver SVX S CGESVX DGESVX ZGESVX
general band - simple driver GB SV S CGBSV DGBSV ZGBSV
general band - expert driver SVX S CGBSVX DGBSVX ZGBSVX
general tridiagonal - simple driver GT SV S CGTSV DGTSV ZGTSV
general tridiagonal - expert driver SVX S CGTSVX DGTSVX ZGTSVX
symmetric/Hermitian - simple driver PO SV S CPOSV DPOSV ZPOSV
positive definite - expert driver SVX S CPOSVX DPOSVX ZPOSVX
symmetric/Hermitian - simple driver PP SV S CPPSV DPPSV ZPPSV
positive definite (packed storage) - expert driver SVX S CPPSVX DPPSVX ZPPSVX
symmetric/Hermitian - simple driver PB SV S CPBSV DPBSV ZPBSV
positive definite band - expert driver SVX S CPBSVX DPBSVX ZPBSVX
symmetric/Hermitian - simple driver PT SV S CPTSV DPTSV ZPTSV
positive definite tridiagonal - expert driver SVX S CPTSVX DPTSVX ZPTSVX
symmetric/Hermitian - simple driver SY SV S CHESV DSYSV ZHESV
indefinite - expert driver SVX S CHESVX DSYSVX ZHESVX
complex symmetric - simple driver SV --- CSYSV --- ZSYSV
complex symmetric - expert driver SVX --- CSYSVX --- ZSYSVX
symmetric/Hermitian - simple driver SP SV SSPSV CHPSV DSPSV ZHPSV
indefinite (packed storage) - expert driver SVX SSPSVX CHPSVX DSPSVX ZHPSVX
complex symmetric - simple driver SV --- CSPSV --- ZSPSV
(packed storage) - expert driver SVX --- CSPSVX --- ZSPSVX

線形最小二乗 (Linear Least Squares)

LLS

Function and storage scheme YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
solve LLS using QR or LQ factorization GE LS SGELS CGELS DGELS ZGELS
solve LLS using complete orthogonal factorization LSY SGELSY CGELSY DGELSY ZGELSY
solve LLS using SVD LSS SGELSS CGELSS DGELSS ZGELSS
solve LLS using divide-and-conquer SVD LSD SGELSD CGELSD DGELSD ZGELSD

一般化線形最小二乗 (Generalized Linear Least Squares)

LSE

Function and storage scheme YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
solve LSE problem using GRQ GG LSE SGGLSE CGGLSE DGGLSE ZGGLSE

GLM

Function and storage scheme YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
solve GLM problem using GQR GG GLM SGGGLM CGGGLM DGGGLM ZGGGLM

標準固有値と特異値 (Standard Eigenvalue and Singular Value)

SEP

Function and storage scheme YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
simple driver SY EV SSYEV CHEEV DSYEV ZHEEV
divide and conquer driver EVD SSYEVD CHEEVD DSYEVD ZHEEVD
expert driver EVX SSYEVX CHEEVX DSYEVX ZHEEVX
RRR driver EVR SSYEVR CHEEVR DSYEVR ZHEEVR
simple driver (packed storage) SP EV SSPEV CHPEV DSPEV ZHPEV
divide and conquer driver (packed storage) EVD SSPEVD CHPEVD DSPEVD ZHPEVD
expert driver (packed storage) EVX SSPEVX CHPEVX DSPEVX ZHPEVX
simple driver (band matrix) SB EV SSBEV CHBEV DSBEV ZHBEV
divide and conquer driver (band matrix) EVD SSBEVD CHBEVD DSBEVD ZHBEVD
expert driver (band matrix) EVX SSBEVX CHBEVX DSBEVX ZHBEVX
simple driver (tridiagonal matrix) ST EV SSTEV --- DSTEV ---
divide and conquer driver (tridiagonal matrix) EVD SSTEVD --- DSTEVD ---
expert driver (tridiagonal matrix) EVX SSTEVX --- DSTEVX ---
RRR driver (tridiagonal matrix) EVR SSTEVR --- DSTEVR ---

NEP

Function and storage scheme YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
simple driver for Schur factorization GE ES SGEES CGEES DGEES ZGEES
expert driver for Schur factorization ESX SGEESX CGEESX DGEESX ZGEESX
simple driver for eigenvalues/vectors EV SGEEV CGEEV DGEEV ZGEEV
expert driver for eigenvalues/vectors EVX SGEEVX CGEEVX DGEEVX ZGEEVX

SVD

Function and storage scheme YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
simple driver GE SVD SGESVD CGESVD DGESVD ZGESVD
divide and conquer driver SDD SGESDD CGESDD DGESDD ZGESDD

一般化固有値と特異値 (Generalized Eigenvalue and Singular Value)

GSEP

Function and storage scheme YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
simple driver SY GV SSYGV CHEGV DSYGV ZHEGV
divide and conquer driver GVD SSYGVD CHEGVD DSYGVD ZHEGVD
expert driver GVX SSYGVX CHEGVX DSYGVX ZHEGVX
simple driver (packed storage) SP GV SSPGV CHPGV DSPGV ZHPGV
divide and conquer driver GVD SSPGVD CHPGVD DSPGVD ZHPGVD
expert driver GVX SSPGVX CHPGVX DSPGVX ZHPGVX
simple driver (band matrices) SB GV SSBGV CHBGV DSBGV ZHBGV
divide and conquer driver GVD SSBGVD CHBGVD DSBGV ZHBGVD
expert driver GVX SSBGVX CHBGVX DSBGVX ZHBGVX

GNEP

Function and storage scheme YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
simple driver for Schur factorization GG ES SGGES CGGES DGGES ZGGES
expert driver for Schur factorization ESX SGGESX CGGESX DGGESX ZGGESX
simple driver for eigenvalues/vectors EV SGGEV CGGEV DGGEV ZGGEV
expert driver for eigenvalues/vectors EVX SGGEVX CGGEVX DGGEVX ZGGEVX

GSVD

Function and storage scheme YY ZZZ 単精度
実数
単精度
素数
倍精度
実数
倍精度
素数
singular values/vectors GG SVD SGGSVD CGGSVD DGGSVD ZGGSVD

おわり

思っていたより種類は少ないですね。

まぁでも65種類だし、あるっちゃーありますね。

CLML Read-Data

CLML Read-Data

CL Machine-Learning を写経

歯脱けが多いけど今はといらえずこれで。

Package

item value
package clml.hjs.read-data
nickname ---
file ./src/hjs/src/read-data.lisp
dependencies ---

Class

class description
dataset 基本クラス
unspecialized-dataset データ読み込み時のクラス
specialized-dataset 列の型が指定されたデータ
numeric-dataset 列の型を numeric で指定したデータ
category-dataset 列の型を category で指定したデータ
numeric-matrix-dataset Dataset represented as matrix (2-dim CL array)
numeric-and-category-dataset 列の型として numeric, category が混在するデータ
numeric-matrix-and-category-dataset Dataset specialized in both numeric (as matrix) and category values.
dimension ...

クラス図

+--------------------------+                        +-----------------+
| dataset                  |                        | dimension       |
|==========================|                        |=================|
| dimensions  simple-array |<-----------------------| name     string |
+--------------------------+                        | type     symbol |
             |                                      | index    fixnum |
             |                                      | metadata list   |
             |                                      +-----------------+
             |
             +-------------------------------+
             |                               |
             V                               V
   +---------------------+       +-----------------------+
   | specialized-dataset |       | unspecialized-dataset |
   |=====================|       |=======================|
   |---------------------|       | points   simple-array |
   +---------------------+       |-----------------------|
             |                   +-----------------------+
             |
             +---------------------------------------|-------------------------------+
             |                                       |                               |
             V                                       V                               V
   +------------------------------+  +-------------------------------+  +------------------------+
   | numeric-dataset              |  | category-dataset              |  | numeric-matrix-dataset |
   |==============================|  |===============================|  |========================|
   | numeric-points  simple-array |  | category-points  simple-array |  | numeric-points    dmat |
   |------------------------------|  |-------------------------------|  |------------------------|
   +------------------------------+  +-------------------------------+  +------------------------+
                        |                 |                |                    |
                        V                 V                V                    V
                 +------------------------------+  +-------------------------------------+
                 | numeric-and-category-dataset |  | numeric-matrix-and-category-dataset |
                 |==============================|  |=====================================|
                 |------------------------------|  |-------------------------------------|
                 +------------------------------+  +-------------------------------------+

Operator

name description
read-data-from-file
pick-and-specialize-data
divide-dataset
choice-dimensions
choice-a-dimension
make-unspecialized-dataset
dataset-cleaning
make-bootstrap-sample-datasets

READ-DATA-FROM-FILE

read-data-from-file filename &key type external-format csv-type-spec csv-header-p missing-value-check missing-values-list
    => unspecialized-dataset

Arguments

attribute description type default
filename &key string
type :sexp or :csv keyword symbol
external-format acl-external-forma
csv-type-spec 第一行は column 名かどうか boolean t
csv-header-p CSV ファイルを読み込みするときの型変更
e.g. '(string integer double-float double-float)
list symbol
missing-value-check 欠損値検出をするかしないか boolean t
missing-values-list 欠損値として判断する値 list '(nil "" "NA")

Values

unspecialized-dataset

Description

  • external-format を指定しない場合、:sexp なら :default、:csv なら :932 (ACL expression for )
  • CSV で読み込む場合の形式は基本的には RFC4180 に従う。
    • 改行は常にデータ行が変わったと解釈するため、フィールドの値として改行をもつことはできない。

References

PICK-AND-SPECIALIZE-DATA

pick-and-specialize-data dataset &key range except data-types
    => numeric-dataset, category-dataset or numeric-and-category-dataset

Arguments

attribute description type default
dataset unspecialized-dataset
range 結果に入る列の指定、0から始まる。 e.g. '(0 1 3 4) all or list integer :all
except :range の逆、結果に入らない列の指定、0からはじまる。e.g. '(2) list integer
data-types 数値型かカテゴリ型か、その型のリスト e.g. '(:category :numeric :numeric) ???

Values

category-dataset と numeric-and-category-dataset は data-type によって自動的に変更する。

attribute description type
numeric-dataset
category-dataset
numeric-and-category-dataset

Description

References

DIVIDE-DATASET

divide-dataset specialized-d &key divide-ratio random range except
    => unspecialized-dataset, numeric-dataset, category-dataset or numeric-and-category-dataset

Arguments

attribute description type default
specialized-d unspecialized-dataset or specialized-dataset
divide-ratio 行分割の比率、nil なら行分割はしない。
e.g. '(1 2 3) なら行を 1:2:3 の比率に分ける。
list non-negative-integer
random t なら行分割はランダムになる boolean
range 結果に入る列の指定、0から始まる。 e.g. '(0 1 3 4) :all or list integer :all
except :range の逆、結果に入らない列の指定、0からはじまる。 e.g. '(2) list integer

Values

attribute description type

Description

  • データを分割する。引数 divide-ratio で行分割の比率を指定して分割する。 range, except で列を限定することもできる。
  • 分割後の行の順番は元のデータに安定。

References

CHOICE-DIMENSIONS

choice-dimensions names data
    => vector vector

Arguments

attribute description type default
names 列名のリスト list string
data unspecialized-dataset or specialized-dataset

Values

attribute description type
vector vector

Description

names で指定した名前をもつ列のデータを取り出す。

References

CHOICE-A-DIMENSION

choice-a-dimension name data
    => vector

Arguments

attribute description type default
name 列名 string
data unspecialized-dataset or specialized-dataset

Values

attribute description type
vector

Description

name で指定した名前をもつ列のデータを取り出す。

References

MAKE-UNSPECIALIZED-DATASET

make-unspecialized-dataset all-column-names data     => unspecialized-dataset

Arguments

attribute description type default
all-column-names list string
data vector vector

Values

attribute description type
unspecialized-dataset

Description

References

DATASET-CLEANING

dataset-cleaning dataset &key interp-types interp-values-alist outlier-types outlier-values     => numeric-dataset or category-dataset or numeric-and-category-dataset

Arguments

attribute description type default
dataset numeric-dataset or
category-dataset or
numeric-and-category-dataset
interp-types
interp-values-alist a-list (key: 列名, datum: 補間方法(:zero :min :max :mean :median :mode :spline)) or
nil
outlier-types a-list (key: 列名, datum: 外れ値検定方法(:std-dev :mean-dev :user :smirnov-grubbs :freq)) or
nil
outlier-values a-list (key: 外れ値検定方法, datum: 検定方法に対応した値) or
nil

Values

attribute description type
numeric-dataset
category-dataset
numeric-and-category-dataset

Description

外れ値検出と欠損値補間を行なう。外れ値検出、欠損値補間の順で処理される。

外れ値検出

outlier-types-alist の key にある各列に対して、datum に指定された方法で外れ値がないか調べる。

外れ値と判定された場合は欠損値に置換される。outlier-types-alist が nil なら外れ値検出は行わない。

outlier-values-alist で、各外れ値検定方法のパラメータを指定する。指定しない場合はデフォルト値が適用される。

外れ値検定方法

数値型( :numeric )の列に対する方法 - 標準偏差(:std-dev) 平均値との差が標準偏差の n 倍より大きかった場合、外れ値とする。n がパラメータ、デフォルト値は 3 - 平均偏差(:mean-dev) 平均値との差が平均偏差の n 倍より大きかった場合、外れ値とする。n がパラメータ、デフォルト値は 3 - スミルノフ・グラッブス検定(:smirnov-grubbs) reference パラメータは 有意水準 を指定する。デフォルト値は 0.05 - ユーザ指定(:user) パラメータとして指定された値を外れ値とする。パラメータは必ず指定しなければならない。

カテゴリ型( :category )の列に対する方法 - 頻度(:freq) データ総数にある値(パラメータ)をかけた値を閾値として、それより少ない頻度の値を外れ値とする。 パラメータのデフォルト値は 0.01 - ユーザ指定(:user) パラメータとして指定された値を外れ値とする。パラメータは必ず指定しなければならない。

欠損値補間

interp-types-alist の key にある各列に対して、datum に指定された方法で欠損値を補間する。

interp-types-alist が nil なら欠損値補間は行わない。

欠損値補間方法

  • 数値型( :numeric )の列に対する方法 ゼロ(:zero), 0 で補間する。 最小値(:min), 最小値で補間する。 最大値(:max), 最大値で補間する。 平均値(:mean), 平均値で補間する。 中央値(:median), 中央値で補間する。 3次スプライン(:spline), 3次スプライン補間を行う。 reference: William H. Press "NUMERICAL RECIPES in C", Chapter3
  • カテゴリ型( :category )の列に対する方法 最頻値(:mode), 最も頻度の高かった値で補間する。

References

MAKE-BOOTSTRAP-SAMPLE-DATASETS

make-bootstrap-sample-datasets dataset &key number-of-datasets     => list unspecialized-dataset or numeric-dataset or category-dataset or numeric-and-category-dataset

Arguments

attribute description type default
dataset unspecialized-dataset or numeric-dataset or category-dataset or numeric-and-category-dataset
number-of-datasets positive-integer 10

Values

attribute description type
list unspecialized-dataset or numeric-dataset or category-dataset or numeric-and-category-dataset

Description

number-of-datasets で指定された個数のブートストラップサンプルデータセットを作成する。

reference: C.M.ビショップ "パターン認識と機械学習 上" p.22

References