SlideShare una empresa de Scribd logo
1 de 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)

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado

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
 

Destacado (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 で高速なプログラムを書く
 

Similar a 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
 

Similar a 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
 

Último

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Último (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

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)

Notas del editor

  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