Definition
Bayesianmethod
TheBayesianmethodisbasedontheBayesianprincipleandusestheknowledgeofprobabilityandstatisticstoclassifythesampledataset.Duetoitssolidmathematicalfoundation,themisjudgmentrateofBayesianclassificationalgorithmisverylow.ThecharacteristicofBayesianmethodistocombinethepriorprobabilityandposteriorprobability,whichavoidsthesubjectivebiasofusingonlythepriorprobability,andalsoavoidstheover-fittingphenomenonofusingthesampleinformationalone.TheBayesianclassificationalgorithmshowsahigheraccuracyratewhenthedatasetislarge,andthealgorithmitselfisrelativelysimple.
NaiveBayesianalgorithm
NaiveBayesianalgorithmisoneofthemostwidelyusedclassificationalgorithms.
NaiveBayesianmethodisbasedontheBayesianalgorithm,whichiscorrespondinglysimplified,thatis,itisassumedthattheattributesareconditionallyindependentofeachotherwhenthetargetvalueisgiven.Thatistosay,noattributevariablehasalargerproportiontothedecisionresult,andnoattributevariablehasasmallerproportiontothedecisionresult.AlthoughthissimplificationmethodreducestheclassificationeffectoftheBayesianclassificationalgorithmtoacertainextent,inactualapplicationscenarios,itgreatlysimplifiesthecomplexityoftheBayesianmethod.
PrincipleofAlgorithm
NaiveBayesClassification(NBC)isamethodbasedonBayes'theoremandassumingthatthefeatureconditionsareindependentofeachother,firstthroughthegiventrainingSet,taketheindependencebetweenfeaturewordsasthepremise,learnthejointprobabilitydistributionfrominputtooutput,andthenbasedonthelearnedmodel,inputtofindtheoutputthatmaximizestheposteriorprobability.
Thereisasampledataset,andthecharacteristicattributesetofthecorrespondingsampledatais.Theclassvariableis,thatis,canbedividedintocategories.Whereismutuallyindependentandrandom,thepriorprobabilityofis,andtheposteriorprobabilityofis,CanbeobtainedbythenaiveBayesalgorithm,theposteriorprobabilitycanbecalculatedfromthepriorprobability,theevidence,theclassconditionalprobability:/p>
NaiveBayesisbasedontheindependenceofeachfeature.Inthecaseofagivencategoryof,theaboveformulaItcanbefurtherexpressedasthefollowingformula:
Fromtheabovetwoformulas,theposteriorprobabilitycanbecalculatedas:
Sincethesizeofisfixed,whencomparingposteriorprobabilities,onlythenumeratoroftheaboveformulacanbecompared.Therefore,anaiveBayesiancalculationwithsampledatabelongingtothecategorycanbeobtained:
incommoditates
commoda
TheNaiveBayesalgorithmassumesthattheattributesofthedatasetareindependentofeachother.Therefore,thelogicofthealgorithmisverysimpleandthealgorithmisrelativelystable.Whenthedatapresentsdifferentcharacteristics,theNaiveBayesalgorithmTheclassificationperformanceofYeshwillnotbemuchdifferent.Inotherwords,therobustnessofthenaiveBayesalgorithmisbetter,anditwillnotshowmuchdifferencefordifferenttypesofdatasets.Whentherelationshipbetweentheattributesofthedatasetisrelativelyindependent,thenaiveBayesclassificationalgorithmwillhavebetterresults.
Incommoda
TheconditionofattributeindependenceisalsotheshortcomingofthenaiveBayesclassifier.Theindependenceoftheattributesofthedatasetisdifficulttosatisfyinmanycases,becausetheattributesofthedatasetareoftenrelatedtoeachother.Ifthiskindofproblemoccursintheclassificationprocess,theeffectoftheclassificationwillbegreatlyreduced.
Applicationem
Textclassification
Classificationisabasicprobleminthefieldofdataanalysisandmachinelearning.Textclassificationhasbeenwidelyusedinmanyaspectssuchasnetworkinformationfiltering,informationretrievalandinformationrecommendation.Data-drivenclassifierlearninghasalwaysbeenahotspotinrecentyears,withmanymethods,suchasneuralnetworks,decisiontrees,supportvectormachines,andnaiveBayes.Comparedwithotherwell-designedandmorecomplexclassificationalgorithms,thenaiveBayesclassificationalgorithmisoneoftheclassifierswithbetterlearningefficiencyandclassificationeffect.TheintuitivetextclassificationalgorithmisalsothesimplestBayesianclassifier.Ithasgoodinterpretability.ThecharacteristicofthenaiveBayesalgorithmisthatitassumesthattheappearanceofallfeaturesareindependentofeachotherandeachfeatureisequallyimportant.Butinfactthisassumptiondoesnotholdintherealworld:firstly,theinevitableconnectionbetweentwoadjacentwordscannotbeindependent;secondly,foranarticle,someoftherepresentativewordsdetermineitstheme.Thereisnoneedtoreadtheentirearticleandlookatallthewords.Therefore,itisnecessarytoadoptasuitablemethodforfeatureselection,sothatthenaiveBayesclassifiercanachievehigherclassificationefficiency.
alii
NaiveBayesalgorithmplaysamoreimportantroleintextrecognitionandimagerecognitiondirection.Anunknowntextorimagecanbeclassifiedaccordingtoitsexistingclassificationrules,andfinallythepurposeofclassificationisachieved.
TheNaiveBayesalgorithmiswidelyusedinreallife,suchastextclassification,spamclassification,creditevaluation,phishingwebsitedetectionandsoon.