Package pyrobot :: Package brain :: Module fuzzy :: Class FuzzyClassifier
[frames | no frames]

Class FuzzyClassifier


Fuzzy classifier class with a membership function and parameters.

Membership function can be set on initialization or with
setMembershipFunction(function). The membership function should
return a value between 0 and 1 (values outside that range will be
automatically set to either 0 or 1).

All relevant parameters used by the membership function can be set
on initialization or by setParams()

Method Summary
  __init__(self, func, fName, ops, **kwargs)
Initialize the FuzzyClassifier...
  __call__(self, *args)
Apply the fuzzy classifier to a set of values...
  __lshift__(self, val)
Return a FuzzyValue classified under a linear falling...
  __nonzero__(self)
  __rshift__(self, val)
Return a FuzzyValue classified under a linear rising...
  __str__(self)
  getParam(self, *names)
Return one or more of the classifier's parameters...
  resetParams(self, **kwargs)
Set all the classifier's parameters at once and...
  safesetParams(self, **kwargs)
Set one or more of the classifier's parameters without overwriting any predefined parameters.
  setFunction(self, func, fName)
Set the classifier's membership function First (required) parameter is the membership function itself.
  setParams(self, **kwargs)
Set one or more of the classifier's parameters without deleting predefined parameters; but will overwrite parameters.

Method Details

__init__(self, func=None, fName=None, ops=<pyrobot.brain.fuzzy.StandardFuzzyOperators instance at 0..., **kwargs)
(Constructor)

Initialize the FuzzyClassifier

First argument is a reference to the membership function
Second argument is the name of the membership function
Remaining arguments are parameter names and values

__call__(self, *args)
(Call operator)

Apply the fuzzy classifier to a set of values

Return a FuzzyValue with value Function(args)

__lshift__(self, val)

Return a FuzzyValue classified under a linear falling
membership function whose parameters are decided by the
current FuzzyClassifier's parameters

Implemented for backwards compatibility

__rshift__(self, val)

Return a FuzzyValue classified under a linear rising
membership function whose parameters are decided by the
current FuzzyClassifier's parameters

Implemented for backwards compatibility

getParam(self, *names)

Return one or more of the classifier's parameters

resetParams(self, **kwargs)

Set all the classifier's parameters at once and
delete all parameters that might already exist

safesetParams(self, **kwargs)

Set one or more of the classifier's parameters
without overwriting any predefined parameters.
If a parameter is already defined safesetParams
will not overwrite it.

setFunction(self, func, fName=None)

Set the classifier's membership function

First (required) parameter is the membership function itself.

Second (optional) parameter is a name for the function, recommended,
e.g., for lambda functions; if this is not set then the function's
actual name will be used

setParams(self, **kwargs)

Set one or more of the classifier's parameters
without deleting predefined parameters; but will
overwrite parameters.

Generated by Epydoc 2.1 on Mon Jul 25 01:39:26 2005 http://epydoc.sf.net