rdkit.ML.NaiveBayes.ClassificationModel module¶
Defines Naive Baysean classification model Based on development in: Chapter 6 of “Machine Learning” by Tom Mitchell
-
class
rdkit.ML.NaiveBayes.ClassificationModel.NaiveBayesClassifier(attrs, nPossibleVals, nQuantBounds, mEstimateVal=-1.0, useSigs=False)¶ Bases:
object_NaiveBayesClassifier_s can save the following pieces of internal state, accessible via standard setter/getter functions:
- _Examples_: a list of examples which have been predicted
- _TrainingExamples_: List of training examples - the descriptor value of these examples
are quantized based on info gain using ML/Data/Quantize.py if necessary- _TestExamples_: the list of examples used to test the model
- _BadExamples_ : list of examples that were incorrectly classified
- _QBoundVals_: Quant bound values for each varaible - a list of lists
- _QBounds_ : Number of bounds for each variable
-
ClassifyExample(example, appendExamples=0)¶ Classify an example by summing over the conditional probabilities The most likely class is the one with the largest probability
-
ClassifyExamples(examples, appendExamples=0)¶
-
GetBadExamples()¶
-
GetClassificationDetails()¶ returns the probability of the last prediction
-
GetExamples()¶
-
GetName()¶
-
GetTestExamples()¶
-
GetTrainingExamples()¶
-
NameModel(varNames)¶
-
SetBadExamples(examples)¶
-
SetExamples(examples)¶
-
SetName(name)¶
-
SetTestExamples(examples)¶
-
SetTrainingExamples(examples)¶
-
trainModel()¶ 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