SlideShare a Scribd company logo
NUMPY
-                       -

        gerumanium3_2
.....
https://gist.github.com/
gerumanium
twitter

ID gerumanium3_2
numpy
Numpy発表資料 tokyoscipy
(Pattern Recognition)
:


    :
Numpy発表資料 tokyoscipy
Discriminant Analysis




z


                            Fisher             (FDA)
    (discrimination)
    (classification)
                                           (LDA)
                                          (QDA)
1.        -
     2.
fisher(1890   1962)
1.                            W
        B
            −1
2. X   =W        B
3. X        λ


4.          L = l 1 x 1 + l 2 x 2 + l 3 x 3 + l4 x 4
x1:
           x2:
          x3:
           x4:

      L = l 1 x 1 + l 2 x 2 + l 3 x 3 + l4 x 4
L ”              L             ”       l1 , l2 , l3 , l4
K
                                  W =         Sk
              L                         k=1

          W   T B   Sk =          (xn − mk )(xn − mk )T
                           n∈Ck

                                 1
W:                          mk =                   xn
                                 Nk
                                         n∈Ck
     T:                     N

B:                   T =         (xn − mn )(xn − m)T
                           m=1

                                  T =W +B
L = l 1 x 1 + l 2 x 2 + l 3 x 3 + l4 x 4



                         l Bl
                     Q≡       → max
                        l Wl
            L




l’Bl l’Wl
Q                   L


            −1
    X=W          B

X       λ


            l1 , l2 , l3 , l4
1.                             W
            B
             −1
2. X   =W           B              linalg.inv()
3. X            λ
       linalg.eig()
4.           L = l 1 x 1 + l 2 x 2 + l 3 x 3 + l4 x 4
numpy
numpy

python
numpy

“iris.txt”
>>from numpy import *
>>data=loadtxt("iris.txt")
>>
>>>#
 >>>Vi=array([data[i] for i in range(0,50)])
 >>>#Vi               Vi.T transpose(Vi)
 >>>Vi=Vi.T
 >>>Vi=array([Vi[i] for i in range(1,5)])
 >>>
                                                 
                                          x   1
                                x2 
x = x1 , x2 , x3 , x4 , x5   →x= 
                                x3 
                                 x4
>>#
>>Ve=array([data[i] for i in range(50,100)])
>>Ve=Ve.T
>>Ve=array([Ve[i] for i in range(1,5)])
>>
>>#
>>Se=array([data[i] for i in range(100,150)])
>>Se=Se.T
>>Se=array([Se[i] for i in range(1,5)])
>>
>>> #
>>> data=data.T
>>> #(4,150)
>>> data=array([data[i] for i in range(1,5)])
>>>
1.                           W
            B
             −1
2. X   =W           B            linalg.inv()
3. X            λ
       linalg.eig()
4.          L = l 1 x 1 + l 2 x 2 + l 3 x 3 + l4 x 4
1.       W
     B
3
              W =         Sk
                    k=1

=           (V in − V¯i)(V in − V i)T
                                 ¯
    n∈V i

+       (V en − V¯e)(V en − V¯e)T
    n∈V e

+                  ¯         ¯ T
            (Sen − Se)(Sen − Se)
    n∈Se
>W=zeros((4,4))
>#Vi
>m1=array([[mean(i) for i in Vi]])
>m1=m1.T
>W+=dot(Vi-m1,transpose(Vi-m1))


     (V in − V¯i)(V in − V i)T
                          ¯
n∈V i
#Ve
>m2=array([[mean(i) for i in Ve]])
>m2=m2.T
>W+=dot(Ve-m2,transpose(Ve-m2))
>


      (V en − V¯e)(V en − V¯e)T
 n∈V e
#Se
>m3=array([[mean(i) for i in Se]])
>m3=m3.T
>W+=dot(Se-m3,transpose(Se-m3))

             ¯         ¯ T
      (Sen − Se)(Sen − Se)
n∈Se
T
      N
                               T
T =         (xn − x)(xn − x)
                  ¯       ¯
      n=1



      B=T−W
>>#
>>M=array([[mean(i) for i in
data]]).T
>>T=dot(data-M,transpose(data-M))

#
>>B=T-W
>>
1.                             W
            B
2.            −1                   linalg.inv()
     X=W            B
3. X            λ
       linalg.eig()
4.           L = l 1 x 1 + l 2 x 2 + l 3 x 3 + l4 x 4
>># linalg.inv()


>>X=dot(linalg.inv(W),B)
>>
1.                             W
            B
             −1
2. X   =W           B              linalg.inv()
3. X            λ
       linalg.eig()
4.           L = l 1 x 1 + l 2 x 2 + l 3 x 3 + l4 x 4
>>>#
>>>#la
>>>#v    la
>>>la,v = linalg.eig(X)
>>> la
array([3.21919292e
+01,2.85391043e-01,
3.25093377e-15,
    3.08736744e-14])
>>>
(1)
L         = −0.20874182x1


      −0.38620369x2


      +0.55401172x3


          +0.7073504x4
L     (    L(1)           L(x)      )
    (2)                       (1)
L         = −0.20874182x1 L         = −0.20874182x1


      −0.38620369x2             −0.38620369x2


      +0.55401172x3             +0.55401172x3


          +0.7073504x4              +0.7073504x4
Numpy発表資料 tokyoscipy
<http://d.hatena.ne.jp/
 gerumanium/>        ...
R
5        (2009)



(2007)

              (2008)

More Related Content

PPT
125 5.2
PPT
125 7.7
PPT
4.2 derivatives of logarithmic functions
PPTX
The chain rule
 
PPTX
Polynomials - Remainder Theorem
KEY
0210 ch 2 day 10
PPTX
4.1 the chain rule
PPTX
Expanding Binomial Brackets
125 5.2
125 7.7
4.2 derivatives of logarithmic functions
The chain rule
 
Polynomials - Remainder Theorem
0210 ch 2 day 10
4.1 the chain rule
Expanding Binomial Brackets

What's hot (20)

PPT
Chain rule
PDF
Lesson 11: The Chain Rule
PPT
PPT
Chain Rule
PPT
PDF
Iit jee question_paper
PPT
Comp decomp worked
PDF
Hw5sols
PPTX
3.3 the fundamental theorem of algebra t
PPT
Solving exponential equations
PDF
Algebra 2 Unit 5 Lesson 2
PPTX
2.1 the basic language of functions t
DOCX
Tugasmatematikakelompok
PPTX
2.1 Revision Game
PDF
Specific Finite Groups(General)
DOCX
Tugasmatematikakelompok 150715235527-lva1-app6892
PPTX
The Chain Rule Powerpoint Lesson
PPTX
Mate tarea - 2º
PDF
Specific Finite Groups(General)
PPTX
Combined Functions
Chain rule
Lesson 11: The Chain Rule
Chain Rule
Iit jee question_paper
Comp decomp worked
Hw5sols
3.3 the fundamental theorem of algebra t
Solving exponential equations
Algebra 2 Unit 5 Lesson 2
2.1 the basic language of functions t
Tugasmatematikakelompok
2.1 Revision Game
Specific Finite Groups(General)
Tugasmatematikakelompok 150715235527-lva1-app6892
The Chain Rule Powerpoint Lesson
Mate tarea - 2º
Specific Finite Groups(General)
Combined Functions
Ad

Viewers also liked (14)

PDF
Fisher線形判別分析とFisher Weight Maps
PDF
FortranからPythonへ
PPTX
Hpcビジネスコンテンスト発表資料
KEY
Pythonについて
PDF
Gpu vs fpga
PPTX
主成分分析 (pca)
PDF
数式をnumpyに落としこむコツ
PDF
10分でわかる主成分分析(PCA)
PDF
はじめよう多変量解析~主成分分析編~
PDF
0528 kanntigai ui_ux
PDF
女子の心をつかむUIデザインポイント - MERY編 -
PDF
20140628_jaws-ug_クラウド女子会_HPC科あゆみ先生 #jawsug
PDF
はじめてのパターン認識 第6章 後半
PDF
Ruby で高速なプログラムを書く
Fisher線形判別分析とFisher Weight Maps
FortranからPythonへ
Hpcビジネスコンテンスト発表資料
Pythonについて
Gpu vs fpga
主成分分析 (pca)
数式をnumpyに落としこむコツ
10分でわかる主成分分析(PCA)
はじめよう多変量解析~主成分分析編~
0528 kanntigai ui_ux
女子の心をつかむUIデザインポイント - MERY編 -
20140628_jaws-ug_クラウド女子会_HPC科あゆみ先生 #jawsug
はじめてのパターン認識 第6章 後半
Ruby で高速なプログラムを書く
Ad

Similar to Numpy発表資料 tokyoscipy (20)

PDF
University of manchester mathematical formula tables
PPT
Interpolation functions
DOC
last lecture in infinite series
DOCX
Tugas matematika kelompok
PDF
Modul 3 quadratic function
PDF
Module 2 polynomial functions
PDF
แคลคูลัสสำหรับการเงินระดับมหาวิทยาลัยcalculus_finance
PDF
Mathematical formula tables
DOCX
Chapter 5 assignment
PDF
Clonal Selection: an Immunological Algorithm for Global Optimization over Con...
PDF
Calculus B Notes (Notre Dame)
PPTX
2. GR9…………………………….>…….. POLYNOMIALS.pptx
PPTX
GRADE 9 REVISION MATHS CAHPTER 2 POLYNOMIALS.pptx
PPTX
Unit 1 Operation on signals
DOCX
some important questions for practice clas 12
PDF
Guia edo todas
POT
PDF
9A%20thejesvi%20math%20journal%20activity%201-7.pdf
DOCX
Series expansion of exponential and logarithmic functions
PDF
Integral table
University of manchester mathematical formula tables
Interpolation functions
last lecture in infinite series
Tugas matematika kelompok
Modul 3 quadratic function
Module 2 polynomial functions
แคลคูลัสสำหรับการเงินระดับมหาวิทยาลัยcalculus_finance
Mathematical formula tables
Chapter 5 assignment
Clonal Selection: an Immunological Algorithm for Global Optimization over Con...
Calculus B Notes (Notre Dame)
2. GR9…………………………….>…….. POLYNOMIALS.pptx
GRADE 9 REVISION MATHS CAHPTER 2 POLYNOMIALS.pptx
Unit 1 Operation on signals
some important questions for practice clas 12
Guia edo todas
9A%20thejesvi%20math%20journal%20activity%201-7.pdf
Series expansion of exponential and logarithmic functions
Integral table

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
A Presentation on Artificial Intelligence
DOCX
The AUB Centre for AI in Media Proposal.docx
PPT
Teaching material agriculture food technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation theory and applications.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Empathic Computing: Creating Shared Understanding
PDF
Electronic commerce courselecture one. Pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
A comparative analysis of optical character recognition models for extracting...
Spectral efficient network and resource selection model in 5G networks
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
MYSQL Presentation for SQL database connectivity
Review of recent advances in non-invasive hemoglobin estimation
Digital-Transformation-Roadmap-for-Companies.pptx
A Presentation on Artificial Intelligence
The AUB Centre for AI in Media Proposal.docx
Teaching material agriculture food technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
Programs and apps: productivity, graphics, security and other tools
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation theory and applications.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
NewMind AI Weekly Chronicles - August'25-Week II
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
“AI and Expert System Decision Support & Business Intelligence Systems”
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
Unlocking AI with Model Context Protocol (MCP)
A comparative analysis of optical character recognition models for extracting...

Numpy発表資料 tokyoscipy

Editor's Notes