ML.SLT.Risk

Package ML :: Package SLT :: Module Risk |
[hide private]
[frames] | no frames]

# Module Risk

source code

    code for calculating empirical risk

Functions | [hide private]
log2(x) | source code
BurgesRiskBound(VCDim, nData, nWrong, conf) Calculates Burges's formulation of the risk bound The formulation is from Eqn. | source code
CristianiRiskBound(VCDim, nData, nWrong, conf) the formulation here is from pg 58, Theorem 4.6 of the book... | source code
CherkasskyRiskBound(VCDim, nData, nWrong, conf, a1=1.0, a2=2.0) The formulation here is from Eqns 4.22 and 4.23 on pg 108 of Cherkassky and Mulier's book "Learning From Data" Wiley, 1998. | source code

Variables | [hide private]
| 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]

### BurgesRiskBound(VCDim, nData, nWrong, conf) | source code
    Calculates Burges's formulation of the risk bound

    The formulation is from Eqn. 3 of Burges's review
    article "A Tutorial on Support Vector Machines for Pattern Recognition"
     In _Data Mining and Knowledge Discovery_ Kluwer Academic Publishers
     (1998) Vol. 2

    **Arguments**

      - VCDim: the VC dimension of the system

      - nData: the number of data points used

      - nWrong: the number of data points misclassified

      - conf: the confidence to be used for this risk bound

    **Returns**

      - a float

    **Notes**

     - This has been validated against the Burges paper

     - I believe that this is only technically valid for binary classification

### CristianiRiskBound(VCDim, nData, nWrong, conf) | source code
    the formulation here is from pg 58, Theorem 4.6 of the book
    "An Introduction to Support Vector Machines" by Cristiani and Shawe-Taylor
    Cambridge University Press, 2000

    **Arguments**

      - VCDim: the VC dimension of the system

      - nData: the number of data points used

      - nWrong: the number of data points misclassified

      - conf: the confidence to be used for this risk bound

    **Returns**

      - a float

    **Notes**

      - this generates odd (mismatching) values

### CherkasskyRiskBound(VCDim, nData, nWrong, conf, a1=1.0, a2=2.0) | source code
    The formulation here is from Eqns 4.22 and 4.23 on pg 108 of
    Cherkassky and Mulier's book "Learning From Data" Wiley, 1998.

    **Arguments**

      - VCDim: the VC dimension of the system

      - nData: the number of data points used

      - nWrong: the number of data points misclassified

      - conf: the confidence to be used for this risk bound

      - a1, a2: constants in the risk equation. Restrictions on these values:

          - 0 <= a1 <= 4

          - 0 <= a2 <= 2

    **Returns**

      - a float

    **Notes**

     - This appears to behave reasonably

     - the equality a1=1.0 is by analogy to Burges's paper.