16
Naive Bayes Apresentado por Carlos Baldove

Naive bayes

Embed Size (px)

Citation preview

Page 1: Naive bayes

Naive BayesApresentado por Carlos Baldove

Page 2: Naive bayes

Introdução“Bayes' Theorem is a simple mathematical formula used for calculating conditional probabilities. It figures prominently in subjectivist or Bayesian approaches to epistemology, statistics, and inductive logic”

Stanford Encyclopedia of Philosophy

Page 3: Naive bayes

Probabilidade Condicional

Page 4: Naive bayes

Simplificando

Page 5: Naive bayes

Teorema de BayesThe probability of a hypothesis H conditional on a given body of data X is the ratio of the unconditional probability of the conjunction of the hypothesis with the data to the unconditional probability of the data alone.

Page 6: Naive bayes

Exemplo

10

6

P(blue)=40/60=2/3

P(red)=20/60=1/3P(blue)+P(red)=1P(yellow)=6/60=1/10

Page 7: Naive bayes

ExemploPensando em P(yellow|red)Separamos o conjunto red de blue, com a área Restante de 20(red) temos 4(yellow), portanto P(yellow|red) = 4/20 = 1/5 E se quisermos P(red|yellow) ?

Page 8: Naive bayes

Exemplo pt2Começamos com:numberOfYellowPegs=P(yellow)⋅totalPegs=1/10⋅60=6numberOfRedPegs=P(red)⋅totalPegs=1/3⋅60=20numberOfRedUnderYellow=P(yellow|red)⋅numberOfRedPegs=1/5⋅20=4

E chegamos a:

Page 9: Naive bayes

Exemplo pt3Expandindo

E finalmente simplificando

Page 10: Naive bayes

Classificador Nayve BayesAlgoritmo utilizado em machine learning especialmente para classificação.É considerado ingênuo pois considera os atributos do espaço probabilístico como sendo independentes

Page 11: Naive bayes

ExemploQual a possibilidade de P(Jogar=sim| Aspecto=sol, Temperatura=fria, Umidade=alta e Vento=forte) ?

Page 12: Naive bayes

Exemplo pt2Aplicando a formula

Page 13: Naive bayes

AplicaçõesO classificador Naive Bayes pode ser aplicados em casos onde baseado em objetos existentes queremos classificar novos objetos desconhecidos desde que os mesmos possuam seus atributos e classes definidos.Ex:Filtro de spamAnalise de perfilMineração de dados

Page 14: Naive bayes

ImplementaçõesWeka/Mahout (Java)Scikit-learn (python)E1071 (R)MLib (Spark)

Page 15: Naive bayes

Referênciashttps://www.countbayesie.com/blog/2015/2/18/bayes-theorem-with-lego

http://betterexplained.com/articles/an-intuitive-and-short-explanation-of-bayes-theorem/

http://plato.stanford.edu/entries/bayes-theorem/

http://www.dinomagri.com

Page 16: Naive bayes

Obrigado