Naive bayes

Preview:

Citation preview

Naive BayesApresentado por Carlos Baldove

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

Probabilidade Condicional

Simplificando

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.

Exemplo

10

6

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

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

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) ?

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:

Exemplo pt3Expandindo

E finalmente simplificando

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

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

Exemplo pt2Aplicando a formula

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

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

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

Obrigado

Recommended