MixtureClassifier¶
(Source code, png, hires.png, pdf)
-
class
MixtureClassifier
(*args)¶ Particular classifier based on a mixture distribution.
- Available constructors:
MixtureClassifier(mixtDist)
- Parameters
- mixtDist
Mixture
A mixture distribution.
- mixtDist
See also
Notes
This implements a mixture classifier which is a particular classifier based on a mixture distribution:
The classifier proposes classes. The rule to assign a point to a class is defined as follows:
See useful methods
classify()
andgrade()
.Methods
classify
(self, \*args)Classify points according to the classifier.
getClassName
(self)Accessor to the object’s name.
getDimension
(self)Accessor to the dimension.
getId
(self)Accessor to the object’s id.
getMixture
(self)Accessor to the mixture distribution.
getName
(self)Accessor to the object’s name.
getNumberOfClasses
(self)Accessor to the number of classes.
getShadowedId
(self)Accessor to the object’s shadowed id.
getVerbose
(self)Accessor to the verbosity.
getVisibility
(self)Accessor to the object’s visibility state.
grade
(self, inP, outC)Grade points according to the classifier.
hasName
(self)Test if the object is named.
hasVisibleName
(self)Test if the object has a distinguishable name.
isParallel
(self)Accessor to the parallel flag.
setMixture
(self, mixture)Accessor to the mixture distribution.
setName
(self, name)Accessor to the object’s name.
setParallel
(self, flag)Accessor to the parallel flag.
setShadowedId
(self, id)Accessor to the object’s shadowed id.
setVerbose
(self, verbose)Accessor to the verbosity.
setVisibility
(self, visible)Accessor to the object’s visibility state.
-
__init__
(self, \*args)¶ Initialize self. See help(type(self)) for accurate signature.
-
classify
(self, \*args)¶ Classify points according to the classifier.
Available usages:
classify(inputPoint)
classify(inputSample)
- Parameters
- inputPointsequence of float
A point to classify.
- inputSample2-d a sequence of float
A set of point to classify.
Notes
The classifier proposes classes where is the dimension of the mixture distribution mixtDist. The rule to assign a point to a class is defined as follows:
In the first usage, it returns an integer which corresponds to the class where inputPoint has been assigned.
In the second usage, it returns an
Indices
that collects the class of each point of inputSample.
-
getClassName
(self)¶ Accessor to the object’s name.
- Returns
- class_namestr
The object class name (object.__class__.__name__).
-
getDimension
(self)¶ Accessor to the dimension.
- Returns
- dimint
The dimension of the classifier.
-
getId
(self)¶ Accessor to the object’s id.
- Returns
- idint
Internal unique identifier.
-
getMixture
(self)¶ Accessor to the mixture distribution.
- Returns
- mixtDist
Mixture
The mixture distribution.
- mixtDist
-
getName
(self)¶ Accessor to the object’s name.
- Returns
- namestr
The name of the object.
-
getNumberOfClasses
(self)¶ Accessor to the number of classes.
- Returns
- n_classesint
The number of classes
-
getShadowedId
(self)¶ Accessor to the object’s shadowed id.
- Returns
- idint
Internal unique identifier.
-
getVerbose
(self)¶ Accessor to the verbosity.
- Returns
- verbbool
Logical value telling if the verbose mode has been activated.
-
getVisibility
(self)¶ Accessor to the object’s visibility state.
- Returns
- visiblebool
Visibility flag.
-
grade
(self, inP, outC)¶ Grade points according to the classifier.
Available usages:
grade(inputPoint, k)
grade(inputSample, classList)
- Parameters
- inputPointsequence of float
A point to grade.
- inputSample2-d a sequence of float
A set of point to grade.
- kinteger
The class number.
- classListsequence of integer
The list of class number.
Notes
The grade of with respect to the class k is .
In the first usage, it returns a real that grades inputPoint with respect to the class k. The greatest, the best.
In the second usage, it returns an
Indices
that collects the grades of the point of inputSample with respect to the class of classList.
-
hasName
(self)¶ Test if the object is named.
- Returns
- hasNamebool
True if the name is not empty.
-
hasVisibleName
(self)¶ Test if the object has a distinguishable name.
- Returns
- hasVisibleNamebool
True if the name is not empty and not the default one.
-
isParallel
(self)¶ Accessor to the parallel flag.
- Returns
- flagbool
Logical value telling if the parallel mode has been activated.
-
setMixture
(self, mixture)¶ Accessor to the mixture distribution.
- Parameters
- mixtDist
Mixture
The mixture distribution.
- mixtDist
-
setName
(self, name)¶ Accessor to the object’s name.
- Parameters
- namestr
The name of the object.
-
setParallel
(self, flag)¶ Accessor to the parallel flag.
- Parameters
- flagbool
Logical value telling if the classification and grading are done in parallel.
-
setShadowedId
(self, id)¶ Accessor to the object’s shadowed id.
- Parameters
- idint
Internal unique identifier.
-
setVerbose
(self, verbose)¶ Accessor to the verbosity.
- Parameters
- verbbool
Logical value telling if the verbose mode has been activated.
-
setVisibility
(self, visible)¶ Accessor to the object’s visibility state.
- Parameters
- visiblebool
Visibility flag.