Fichier:Naive Bayes Classifier.gif
Naive_Bayes_Classifier.gif (451 × 359 pixels, taille du fichier : 1,02 Mio, type MIME : image/gif, en boucle, 60 trames, 30 s)
Ce fichier et sa description proviennent de Wikimedia Commons.
Description
DescriptionNaive Bayes Classifier.gif |
English: A "Naive Bayes Classifier" is a simple and computationally inexpensive way to estimate how likely it is that a certain combination of features can be attributed to a given class. As more measurements are fed to the classifier, the estimate is updated. |
Date | |
Source | https://twitter.com/j_bertolotti/status/1123268194758811648 |
Auteur | Jacopo Bertolotti |
Autorisation (Réutilisation de ce fichier) |
https://twitter.com/j_bertolotti/status/1030470604418428929 |
Mathematica 11.0 code
n = 20; red[z_] := {Opacity[z], Red}; purple[z_] := {Opacity[z], Purple}; cyan[z_] := {Opacity[z], Cyan} pop1 = RandomVariate[MultinormalDistribution[{3, 4}, {{1, 1}, {1, 2}}], n]; pop2 = RandomVariate[MultinormalDistribution[{6, 4}, {{0.5, 0}, {0, 1}}], n]; pop3 = RandomVariate[MultinormalDistribution[{6, 8}, {{2, 0}, {0, 0.5}}], n]; meas = RandomSample[Join[pop1, pop2, pop3]]; meascol = Table[Which[MemberQ[pop1, meas[[j]]], 1, MemberQ[pop2, meas[[j]]], 2, MemberQ[pop3, meas[[j]]], 3], {j, 1, Dimensions[meas][[1]]}] plots = Table[ p1 = Count[meascol[[1 ;; j]], 1]/j; \[Mu]x1 = Mean@Extract[meas, Position[meascol[[1 ;; j]], 1]][[All, 1]]; \[Mu]y1 = Mean@Extract[meas, Position[meascol[[1 ;; j]], 1]][[All, 2]]; \[Sigma]x1 = Sqrt[Total[(Extract[meas, Position[meascol[[1 ;; j]], 1]][[All, 1]] - \[Mu]x1)^2]/(p1*j)]; \[Sigma]y1 = Sqrt[Total[(Extract[meas, Position[meascol[[1 ;; j]], 1]][[All, 2]] - \[Mu]y1)^2]/(p1*j)]; p1x = If[\[Sigma]x1 == 0, 0, PDF[NormalDistribution[\[Mu]x1, \[Sigma]x1], x]]; p1y = If[\[Sigma]y1 == 0, 0, PDF[NormalDistribution[\[Mu]y1, \[Sigma]y1], y]]; p2 = Count[meascol[[1 ;; j]], 2]/j; \[Mu]x2 = Mean@Extract[meas, Position[meascol[[1 ;; j]], 2]][[All, 1]]; \[Mu]y2 = Mean@Extract[meas, Position[meascol[[1 ;; j]], 2]][[All, 2]]; \[Sigma]x2 = Sqrt[Total[(Extract[meas, Position[meascol[[1 ;; j]], 2]][[All, 1]] - \[Mu]x2)^2]/(p2*j)]; \[Sigma]y2 = Sqrt[Total[(Extract[meas, Position[meascol[[1 ;; j]], 2]][[All, 2]] - \[Mu]y2)^2]/(p2*j)]; p2x = If[\[Sigma]x2 == 0, 0, PDF[NormalDistribution[\[Mu]x2, \[Sigma]x2], x]]; p2y = If[\[Sigma]y2 == 0, 0, PDF[NormalDistribution[\[Mu]y2, \[Sigma]y2], y]]; p3 = Count[meascol[[1 ;; j]], 3]/j; \[Mu]x3 = Mean@Extract[meas, Position[meascol[[1 ;; j]], 3]][[All, 1]]; \[Mu]y3 = Mean@Extract[meas, Position[meascol[[1 ;; j]], 3]][[All, 2]]; \[Sigma]x3 = Sqrt[Total[(Extract[meas, Position[meascol[[1 ;; j]], 3]][[All, 1]] - \[Mu]x3)^2]/(p3*j)]; \[Sigma]y3 = Sqrt[Total[(Extract[meas, Position[meascol[[1 ;; j]], 3]][[All, 2]] - \[Mu]y3)^2]/(p3*j)]; p3x = If[\[Sigma]x3 == 0, 0, PDF[NormalDistribution[\[Mu]x3, \[Sigma]x3], x]]; p3y = If[\[Sigma]y3 == 0, 0, PDF[NormalDistribution[\[Mu]y3, \[Sigma]y3], y]]; Legended[Show[ ContourPlot[p1*p1x*p1y, {x, 0, 10}, {y, 0, 10}, ColorFunction -> red, PlotRange -> All, PlotPoints -> 50] , ContourPlot[p2*p2x*p2y, {x, 0, 10}, {y, 0, 10}, ColorFunction -> purple, PlotRange -> All, PlotPoints -> 50] , ContourPlot[p3*p3x*p3y, {x, 0, 10}, {y, 0, 10}, ColorFunction -> cyan, PlotRange -> All, PlotPoints -> 50] , Graphics[{PointSize[0.02], Black, Point[Join[Extract[meas, Position[meascol[[1 ;; j]], 1]], Extract[meas, Position[meascol[[1 ;; j]], 2]], Extract[meas, Position[meascol[[1 ;; j]], 3]]]], PointSize[0.015], Red, Point[Extract[meas, Position[meascol[[1 ;; j]], 1]]], Purple, Point[Extract[meas, Position[meascol[[1 ;; j]], 2]]], Cyan, Point[Extract[meas, Position[meascol[[1 ;; j]], 3]]]}] , PlotRange -> All, FrameLabel -> {"Feature 1", "Feature 2"}, LabelStyle -> {Bold, Black} ], SwatchLegend[{Red, Purple, Cyan}, {"Class Lucas", "Class B", "Class C"}] ] , {j, 1, n*3}];
Conditions d’utilisation
Ce fichier est disponible selon les termes de la licence Creative Commons CC0 Don universel au domaine public. | |
La personne qui a associé une œuvre avec cet acte l’a placée dans le domaine public en renonçant mondialement à tous ses droits sur cette œuvre en vertu des lois relatives au droit d’auteur, ainsi qu’à tous les droits juridiques connexes et voisins qu’elle possédait sur l’œuvre, sans autre limite que celles imposées par la loi. Vous pouvez copier, modifier, distribuer et utiliser cette œuvre, y compris à des fins commerciales, sans qu’il soit nécessaire d’en demander la permission.
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse |
Éléments décrits dans ce fichier
dépeint
Valeur sans élément de Wikidata
30 avril 2019
image/gif
Historique du fichier
Cliquer sur une date et heure pour voir le fichier tel qu'il était à ce moment-là.
Date et heure | Vignette | Dimensions | Utilisateur | Commentaire | |
---|---|---|---|---|---|
actuel | 1 mai 2019 à 10:46 | 451 × 359 (1,02 Mio) | Berto | User created page with UploadWizard |
Utilisation du fichier
La page suivante utilise ce fichier :
Usage global du fichier
Les autres wikis suivants utilisent ce fichier :
- Utilisation sur ca.wikipedia.org
Métadonnées
Ce fichier contient des informations supplémentaires, probablement ajoutées par l'appareil photo numérique ou le numériseur utilisé pour le créer.
Si le fichier a été modifié depuis son état original, certains détails peuvent ne pas refléter entièrement l'image modifiée.
Commentaire de fichier GIF | Created with the Wolfram Language : www.wolfram.com |
---|