ML.NaiveBayes.ClassificationModel.NaiveBayesClassifier

Package ML :: Package NaiveBayes :: Module ClassificationModel :: Class NaiveBayesClassifier |
[hide private]
[frames] | no frames]

# Class NaiveBayesClassifier

source code

    _NaiveBayesClassifier_s can save the following pieces of internal state, accessible via
    standard setter/getter functions:

    1) _Examples_: a list of examples which have been predicted

    2) _TrainingExamples_: List of training examples - the descriptor value of these examples
      are quantized based on info gain using ML/Data/Quantize.py if necessary

    3) _TestExamples_: the list of examples used to test the model

    4) _BadExamples_ : list of examples that were incorrectly classified

    4) _QBoundVals_: Quant bound values for each varaible - a list of lists

    5) _QBounds_ : Number of bounds for each variable

Instance Methods | [hide private]
__init__(self, attrs, nPossibleVals, nQuantBounds, mEstimateVal=-1.0, useSigs=False) Constructor... | source code
GetName(self) | source code
SetName(self, name) | source code
NameModel(self, varNames) | source code
GetExamples(self) | source code
SetExamples(self, examples) | source code
GetTrainingExamples(self) | source code
SetTrainingExamples(self, examples) | source code
GetTestExamples(self) | source code
SetTestExamples(self, examples) | source code
SetBadExamples(self, examples) | source code
GetBadExamples(self) | source code
_computeQuantBounds(self) | source code
trainModel(self) We will assume at this point that the training examples have been set We have to estmate the conditional probabilities for each of the (binned) descriptor component give a outcome (or class). | source code
ClassifyExamples(self, examples, appendExamples=0) | source code
GetClassificationDetails(self) returns the probability of the last prediction | source code
ClassifyExample(self, example, appendExamples=0) Classify an example by summing over the conditional probabilities... | source code

Method Details | [hide private]

### __init__(self, attrs, nPossibleVals, nQuantBounds, mEstimateVal=-1.0, useSigs=False) (Constructor) | source code
    Constructor

### trainModel(self) | source code
    We will assume at this point that the training examples have been set

    We have to estmate the conditional probabilities for each of the (binned) descriptor
    component give a outcome (or class). Also the probabilities for each class is estimated

### ClassifyExample(self, example, appendExamples=0) | source code
    Classify an example by summing over the conditional probabilities
    The most likely class is the one with the largest probability