Package ML :: Package InfoTheory :: Module entropy
[hide private]
[frames] | no frames]

Module entropy

source code

Informational Entropy functions

The definitions used are the same as those in Tom Mitchell's
book "Machine Learning"



Functions [hide private]
 
PyInfoEntropy(results)
Calculates the informational entropy of a set of results.
source code
 
PyInfoGain(varMat)
calculates the information gain for a variable **Arguments** varMat is a Numeric array with the number of possible occurances of each result for reach possible value of the given variable.
source code
 
InfoEntropy(...)
calculates the informational entropy of the values in an array ARGUMENTS: - resMat: pointer to a long int array containing the data - dim: long int containing the length of the _tPtr_ array.
source code
 
InfoGain(varMat)
Calculates the information gain for a variable ARGUMENTS: - varMat: a Numeric Array object varMat is a Numeric array with the number of possible occurances of each result for reach possible value of the given variable.
source code
Variables [hide private]
  hascEntropy = 1
  _log2 = 0.69314718056
  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'>
Function Details [hide private]

PyInfoEntropy(results)

source code 
Calculates the informational entropy of a set of results.

**Arguments**

  results is a 1D Numeric array containing the number of times a
  given set hits each possible result.
  For example, if a function has 3 possible results, and the
    variable in question hits them 5, 6 and 1 times each,
    results would be [5,6,1]

**Returns**

  the informational entropy

PyInfoGain(varMat)

source code 
calculates the information gain for a variable

**Arguments**

  varMat is a Numeric array with the number of possible occurances
    of each result for reach possible value of the given variable.

  So, for a variable which adopts 4 possible values and a result which
    has 3 possible values, varMat would be 4x3

**Returns**

  The expected information gain

InfoEntropy(...)

source code 
calculates the informational entropy of the values in an array

  ARGUMENTS:
    
    - resMat: pointer to a long int array containing the data
    - dim: long int containing the length of the _tPtr_ array.

  RETURNS:

    a double

C++ signature:
    InfoEntropy(boost::python::api::object) -> double

InfoGain(varMat)

source code 
Calculates the information gain for a variable

   ARGUMENTS:

     - varMat: a Numeric Array object
       varMat is a Numeric array with the number of possible occurances
         of each result for reach possible value of the given variable.

       So, for a variable which adopts 4 possible values and a result which
         has 3 possible values, varMat would be 4x3

   RETURNS:

     - a Python float object

   NOTES

     - this is a dropin replacement for _PyInfoGain()_ in entropy.py

C++ signature:
    InfoGain(boost::python::api::object) -> double