This provides code for a general Naive Bayes learner.
Naive Bayes is a supervised classification algorithm that uses Bayes
rule to compute the fit between a new observation and some previously
observed data. The observations are discrete feature vectors, with the
Bayes assumption that the features are independent. Although this is
hardly ever true, the classifier works well enough in practice.
Glossary: observation A feature vector of discrete data. class
A possible classification for an observation.
Classes: NaiveBayes Holds information for a naive Bayes
classifier.
Functions: train Train a new naive Bayes classifier.
calculate Calculate the probabilities of each class, given an
observation. classify Classify an observation into a class.
|
Complex0 = ' F '
|
|
Complex16 = ' F '
|
|
Complex32 = ' F '
|
|
Complex64 = ' D '
|
|
Complex8 = ' F '
|
|
Float0 = ' f '
|
|
Float16 = ' f '
|
|
Float32 = ' f '
|
|
Float64 = ' d '
|
|
Float8 = ' f '
|
|
Int0 = ' 1 '
|
|
Int16 = ' s '
|
|
Int32 = ' i '
|
|
Int8 = ' 1 '
|
|
absolute = <ufunc 'absolute'>
|
|
add = <ufunc 'add'>
|
|
arccos = <ufunc 'arccos'>
|
|
arccosh = <ufunc 'arccosh'>
|
|
arcsin = <ufunc 'arcsin'>
|
|
arcsinh = <ufunc 'arcsinh'>
|
|
arctan = <ufunc 'arctan'>
|
|
arctan2 = <ufunc 'arctan2'>
|
|
arctanh = <ufunc 'arctanh'>
|
|
bitwise_and = <ufunc 'bitwise_and'>
|
|
bitwise_or = <ufunc 'bitwise_or'>
|
|
bitwise_xor = <ufunc 'bitwise_xor'>
|
|
ceil = <ufunc 'ceil'>
|
|
conjugate = <ufunc 'conjugate'>
|
|
cos = <ufunc 'cos'>
|
|
cosh = <ufunc 'cosh'>
|
|
divide = <ufunc 'divide'>
|
|
divide_safe = <ufunc 'divide_safe'>
|
|
e = 2.71828182846
|
|
equal = <ufunc 'equal'>
|
|
exp = <ufunc 'exp'>
|
|
fabs = <ufunc 'fabs'>
|
|
floor = <ufunc 'floor'>
|
|
floor_divide = <ufunc 'floor_divide'>
|
|
fmod = <ufunc 'fmod'>
|
|
greater = <ufunc 'greater'>
|
|
greater_equal = <ufunc 'greater_equal'>
|
|
hypot = <ufunc 'hypot'>
|
|
invert = <ufunc 'invert'>
|
|
left_shift = <ufunc 'left_shift'>
|
|
less = <ufunc 'less'>
|
|
less_equal = <ufunc 'less_equal'>
|
|
log = <ufunc 'log'>
|
|
log10 = <ufunc 'log10'>
|
|
logical_and = <ufunc 'logical_and'>
|
|
logical_not = <ufunc 'logical_not'>
|
|
logical_or = <ufunc 'logical_or'>
|
|
logical_xor = <ufunc 'logical_xor'>
|
|
maximum = <ufunc 'maximum'>
|
|
minimum = <ufunc 'minimum'>
|
|
multiply = <ufunc 'multiply'>
|
|
negative = <ufunc 'negative'>
|
|
not_equal = <ufunc 'not_equal'>
|
|
pi = 3.14159265359
|
|
power = <ufunc 'power'>
|
|
remainder = <ufunc 'remainder'>
|
|
right_shift = <ufunc 'right_shift'>
|
|
sin = <ufunc 'sin'>
|
|
sinh = <ufunc 'sinh'>
|
|
sqrt = <ufunc 'sqrt'>
|
|
subtract = <ufunc 'subtract'>
|
|
tan = <ufunc 'tan'>
|
|
tanh = <ufunc 'tanh'>
|
|
true_divide = <ufunc 'true_divide'>
|