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(results)
InfoEntropy( (AtomPairsParameters)arg1) -> float : 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(...)
InfoGain( (AtomPairsParameters)arg1) -> float : 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
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(results)

source code 

InfoEntropy( (AtomPairsParameters)arg1) -> float :
    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 :
        double InfoEntropy(boost::python::api::object)

InfoGain(...)

source code 

InfoGain( (AtomPairsParameters)arg1) -> float :
    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 :
        double InfoGain(boost::python::api::object)