SlideShare une entreprise Scribd logo
1  sur  41
NUMPY
-                       -

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

ID gerumanium3_2
numpy
(Pattern Recognition)
:


    :
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
<http://d.hatena.ne.jp/
 gerumanium/>        ...
R
5        (2009)



(2007)

              (2008)

Contenu connexe

Tendances

Iit jee question_paper
Iit jee question_paperIit jee question_paper
Iit jee question_paperRahulMishra774
 
Comp decomp worked
Comp decomp workedComp decomp worked
Comp decomp workedJonna Ramsey
 
3.3 the fundamental theorem of algebra t
3.3 the fundamental theorem of algebra t3.3 the fundamental theorem of algebra t
3.3 the fundamental theorem of algebra tmath260
 
Solving exponential equations
Solving exponential equationsSolving exponential equations
Solving exponential equationsShaun Wilson
 
Algebra 2 Unit 5 Lesson 2
Algebra 2 Unit 5 Lesson 2Algebra 2 Unit 5 Lesson 2
Algebra 2 Unit 5 Lesson 2Kate Nowak
 
2.1 the basic language of functions t
2.1 the basic language of functions  t2.1 the basic language of functions  t
2.1 the basic language of functions tmath260
 
Tugasmatematikakelompok
TugasmatematikakelompokTugasmatematikakelompok
Tugasmatematikakelompokgundul28
 
2.1 Revision Game
2.1 Revision Game2.1 Revision Game
2.1 Revision Gamealihamp
 
Specific Finite Groups(General)
Specific Finite Groups(General)Specific Finite Groups(General)
Specific Finite Groups(General)Shane Nicklas
 
Tugasmatematikakelompok 150715235527-lva1-app6892
Tugasmatematikakelompok 150715235527-lva1-app6892Tugasmatematikakelompok 150715235527-lva1-app6892
Tugasmatematikakelompok 150715235527-lva1-app6892drayertaurus
 
The Chain Rule Powerpoint Lesson
The Chain Rule Powerpoint LessonThe Chain Rule Powerpoint Lesson
The Chain Rule Powerpoint LessonPaul Hawks
 
Specific Finite Groups(General)
Specific Finite Groups(General)Specific Finite Groups(General)
Specific Finite Groups(General)Shane Nicklas
 
Combined Functions
Combined FunctionsCombined Functions
Combined FunctionsJoviBerbz
 

Tendances (20)

Chain rule
Chain ruleChain rule
Chain rule
 
Lesson 11: The Chain Rule
Lesson 11: The Chain RuleLesson 11: The Chain Rule
Lesson 11: The Chain Rule
 
Parabola
ParabolaParabola
Parabola
 
Chain Rule
Chain RuleChain Rule
Chain Rule
 
Vertex
VertexVertex
Vertex
 
Iit jee question_paper
Iit jee question_paperIit jee question_paper
Iit jee question_paper
 
Comp decomp worked
Comp decomp workedComp decomp worked
Comp decomp worked
 
Hw5sols
Hw5solsHw5sols
Hw5sols
 
3.3 the fundamental theorem of algebra t
3.3 the fundamental theorem of algebra t3.3 the fundamental theorem of algebra t
3.3 the fundamental theorem of algebra t
 
Solving exponential equations
Solving exponential equationsSolving exponential equations
Solving exponential equations
 
Algebra 2 Unit 5 Lesson 2
Algebra 2 Unit 5 Lesson 2Algebra 2 Unit 5 Lesson 2
Algebra 2 Unit 5 Lesson 2
 
2.1 the basic language of functions t
2.1 the basic language of functions  t2.1 the basic language of functions  t
2.1 the basic language of functions t
 
Tugasmatematikakelompok
TugasmatematikakelompokTugasmatematikakelompok
Tugasmatematikakelompok
 
2.1 Revision Game
2.1 Revision Game2.1 Revision Game
2.1 Revision Game
 
Specific Finite Groups(General)
Specific Finite Groups(General)Specific Finite Groups(General)
Specific Finite Groups(General)
 
Tugasmatematikakelompok 150715235527-lva1-app6892
Tugasmatematikakelompok 150715235527-lva1-app6892Tugasmatematikakelompok 150715235527-lva1-app6892
Tugasmatematikakelompok 150715235527-lva1-app6892
 
The Chain Rule Powerpoint Lesson
The Chain Rule Powerpoint LessonThe Chain Rule Powerpoint Lesson
The Chain Rule Powerpoint Lesson
 
Mate tarea - 2º
Mate   tarea - 2ºMate   tarea - 2º
Mate tarea - 2º
 
Specific Finite Groups(General)
Specific Finite Groups(General)Specific Finite Groups(General)
Specific Finite Groups(General)
 
Combined Functions
Combined FunctionsCombined Functions
Combined Functions
 

En vedette

Fisher線形判別分析とFisher Weight Maps
Fisher線形判別分析とFisher Weight MapsFisher線形判別分析とFisher Weight Maps
Fisher線形判別分析とFisher Weight MapsTakao Yamanaka
 
Hpcビジネスコンテンスト発表資料
Hpcビジネスコンテンスト発表資料Hpcビジネスコンテンスト発表資料
Hpcビジネスコンテンスト発表資料Hironori Nakajo
 
主成分分析 (pca)
主成分分析 (pca)主成分分析 (pca)
主成分分析 (pca)Ji Wang
 
数式をnumpyに落としこむコツ
数式をnumpyに落としこむコツ数式をnumpyに落としこむコツ
数式をnumpyに落としこむコツShuyo Nakatani
 
10分でわかる主成分分析(PCA)
10分でわかる主成分分析(PCA)10分でわかる主成分分析(PCA)
10分でわかる主成分分析(PCA)Takanori Ogata
 
はじめよう多変量解析~主成分分析編~
はじめよう多変量解析~主成分分析編~はじめよう多変量解析~主成分分析編~
はじめよう多変量解析~主成分分析編~宏喜 佐野
 
0528 kanntigai ui_ux
0528 kanntigai ui_ux0528 kanntigai ui_ux
0528 kanntigai ui_uxSaori Matsui
 
女子の心をつかむUIデザインポイント - MERY編 -
女子の心をつかむUIデザインポイント - MERY編 -女子の心をつかむUIデザインポイント - MERY編 -
女子の心をつかむUIデザインポイント - MERY編 -Shoko Tanaka
 
20140628_jaws-ug_クラウド女子会_HPC科あゆみ先生 #jawsug
20140628_jaws-ug_クラウド女子会_HPC科あゆみ先生  #jawsug20140628_jaws-ug_クラウド女子会_HPC科あゆみ先生  #jawsug
20140628_jaws-ug_クラウド女子会_HPC科あゆみ先生 #jawsugAyumi Tada
 
はじめてのパターン認識 第6章 後半
はじめてのパターン認識 第6章 後半はじめてのパターン認識 第6章 後半
はじめてのパターン認識 第6章 後半Prunus 1350
 
Ruby で高速なプログラムを書く
Ruby で高速なプログラムを書くRuby で高速なプログラムを書く
Ruby で高速なプログラムを書くmametter
 

En vedette (14)

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

Similaire à Numpy発表資料 tokyoscipy

University of manchester mathematical formula tables
University of manchester mathematical formula tablesUniversity of manchester mathematical formula tables
University of manchester mathematical formula tablesGaurav Vasani
 
Interpolation functions
Interpolation functionsInterpolation functions
Interpolation functionsTarun Gehlot
 
last lecture in infinite series
last lecture in infinite serieslast lecture in infinite series
last lecture in infinite seriesAlaa Mohammed
 
Tugas matematika kelompok
Tugas matematika kelompokTugas matematika kelompok
Tugas matematika kelompokachmadtrybuana
 
Modul 3 quadratic function
Modul 3 quadratic functionModul 3 quadratic function
Modul 3 quadratic functionHafidz Mukhtar
 
Module 2 polynomial functions
Module 2   polynomial functionsModule 2   polynomial functions
Module 2 polynomial functionsdionesioable
 
Mathematical formula tables
Mathematical formula tablesMathematical formula tables
Mathematical formula tablesSaravana Selvan
 
Clonal Selection: an Immunological Algorithm for Global Optimization over Con...
Clonal Selection: an Immunological Algorithm for Global Optimization over Con...Clonal Selection: an Immunological Algorithm for Global Optimization over Con...
Clonal Selection: an Immunological Algorithm for Global Optimization over Con...Mario Pavone
 
Calculus B Notes (Notre Dame)
Calculus B Notes (Notre Dame)Calculus B Notes (Notre Dame)
Calculus B Notes (Notre Dame)Laurel Ayuyao
 
Unit 1 Operation on signals
Unit 1  Operation on signalsUnit 1  Operation on signals
Unit 1 Operation on signalsDr.SHANTHI K.G
 
some important questions for practice clas 12
some important questions for practice clas 12  some important questions for practice clas 12
some important questions for practice clas 12 nitishguptamaps
 
9A%20thejesvi%20math%20journal%20activity%201-7.pdf
9A%20thejesvi%20math%20journal%20activity%201-7.pdf9A%20thejesvi%20math%20journal%20activity%201-7.pdf
9A%20thejesvi%20math%20journal%20activity%201-7.pdfThejesviIrugu1
 
Series expansion of exponential and logarithmic functions
Series expansion of exponential and logarithmic functionsSeries expansion of exponential and logarithmic functions
Series expansion of exponential and logarithmic functionsindu psthakur
 
Integral table
Integral tableIntegral table
Integral tableAnkitcos0
 
Single page-integral-table
Single page-integral-tableSingle page-integral-table
Single page-integral-tableMonique Anderson
 

Similaire à Numpy発表資料 tokyoscipy (20)

University of manchester mathematical formula tables
University of manchester mathematical formula tablesUniversity of manchester mathematical formula tables
University of manchester mathematical formula tables
 
Interpolation functions
Interpolation functionsInterpolation functions
Interpolation functions
 
last lecture in infinite series
last lecture in infinite serieslast lecture in infinite series
last lecture in infinite series
 
Tugas matematika kelompok
Tugas matematika kelompokTugas matematika kelompok
Tugas matematika kelompok
 
Modul 3 quadratic function
Modul 3 quadratic functionModul 3 quadratic function
Modul 3 quadratic function
 
Module 2 polynomial functions
Module 2   polynomial functionsModule 2   polynomial functions
Module 2 polynomial functions
 
Mathematical formula tables
Mathematical formula tablesMathematical formula tables
Mathematical formula tables
 
Chapter 5 assignment
Chapter 5 assignmentChapter 5 assignment
Chapter 5 assignment
 
Clonal Selection: an Immunological Algorithm for Global Optimization over Con...
Clonal Selection: an Immunological Algorithm for Global Optimization over Con...Clonal Selection: an Immunological Algorithm for Global Optimization over Con...
Clonal Selection: an Immunological Algorithm for Global Optimization over Con...
 
Calculus B Notes (Notre Dame)
Calculus B Notes (Notre Dame)Calculus B Notes (Notre Dame)
Calculus B Notes (Notre Dame)
 
Unit 1 Operation on signals
Unit 1  Operation on signalsUnit 1  Operation on signals
Unit 1 Operation on signals
 
some important questions for practice clas 12
some important questions for practice clas 12  some important questions for practice clas 12
some important questions for practice clas 12
 
Guia edo todas
Guia edo todasGuia edo todas
Guia edo todas
 
MS2 POwer Rules
MS2 POwer RulesMS2 POwer Rules
MS2 POwer Rules
 
9A%20thejesvi%20math%20journal%20activity%201-7.pdf
9A%20thejesvi%20math%20journal%20activity%201-7.pdf9A%20thejesvi%20math%20journal%20activity%201-7.pdf
9A%20thejesvi%20math%20journal%20activity%201-7.pdf
 
Series expansion of exponential and logarithmic functions
Series expansion of exponential and logarithmic functionsSeries expansion of exponential and logarithmic functions
Series expansion of exponential and logarithmic functions
 
Integral table
Integral tableIntegral table
Integral table
 
Calculus Final Exam
Calculus Final ExamCalculus Final Exam
Calculus Final Exam
 
整卷
整卷整卷
整卷
 
Single page-integral-table
Single page-integral-tableSingle page-integral-table
Single page-integral-table
 

Dernier

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 

Dernier (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

Numpy発表資料 tokyoscipy

  • 1. NUMPY - - gerumanium3_2
  • 6.
  • 8. : :
  • 9.
  • 10. Discriminant Analysis z Fisher (FDA) (discrimination) (classification) (LDA) (QDA)
  • 11. 1. - 2.
  • 12. fisher(1890 1962)
  • 13. 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
  • 14. 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
  • 15. 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
  • 16. 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
  • 17. Q L −1 X=W B X λ l1 , l2 , l3 , l4
  • 18. 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
  • 19. numpy
  • 21. >>from numpy import * >>data=loadtxt("iris.txt") >>
  • 22. >>># >>>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
  • 23. >># >>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)]) >>
  • 24. >>> # >>> data=data.T >>> #(4,150) >>> data=array([data[i] for i in range(1,5)]) >>>
  • 25. 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
  • 26. 1. W B
  • 27. 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
  • 28. >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
  • 29. #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
  • 30. #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
  • 31. T N T T = (xn − x)(xn − x) ¯ ¯ n=1 B=T−W
  • 32. >># >>M=array([[mean(i) for i in data]]).T >>T=dot(data-M,transpose(data-M)) # >>B=T-W >>
  • 33. 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
  • 35. 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
  • 36. >>># >>>#la >>>#v la >>>la,v = linalg.eig(X) >>> la array([3.21919292e +01,2.85391043e-01, 3.25093377e-15, 3.08736744e-14]) >>>
  • 37. (1) L = −0.20874182x1 −0.38620369x2 +0.55401172x3 +0.7073504x4
  • 38. 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
  • 39.
  • 41. R 5 (2009) (2007) (2008)

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n