MixtureClassifier¶
(Source code
, png
)
- class MixtureClassifier(*args)¶
Particular classifier based on a mixture distribution.
- Parameters:
- mixtDist
Mixture
A mixture distribution.
- mixtDist
Methods
classify
(*args)Classify points according to the classifier.
Accessor to the object's name.
Accessor to the dimension.
Accessor to the mixture distribution.
getName
()Accessor to the object's name.
Accessor to the number of classes.
grade
(*args)Grade points according to the classifier.
hasName
()Test if the object is named.
Accessor to the parallel flag.
setMixture
(mixture)Accessor to the mixture distribution.
setName
(name)Accessor to the object's name.
setParallel
(flag)Accessor to the parallel flag.
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()
.- __init__(*args)¶
- classify(*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()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getDimension()¶
Accessor to the dimension.
- Returns:
- dimint
The dimension of the classifier.
- getMixture()¶
Accessor to the mixture distribution.
- Returns:
- mixtDist
Mixture
The mixture distribution.
- mixtDist
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- getNumberOfClasses()¶
Accessor to the number of classes.
- Returns:
- n_classesint
The number of classes
- grade(*args)¶
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.
- kint
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 value that grades inputPoint with respect to the class k. The larger, the better.
In the second usage, it returns a
Point
that collects the grades of the element of inputSample with respect to the class of classList.
- hasName()¶
Test if the object is named.
- Returns:
- hasNamebool
True if the name is not empty.
- isParallel()¶
Accessor to the parallel flag.
- Returns:
- flagbool
Logical value telling if the parallel mode has been activated.
- setMixture(mixture)¶
Accessor to the mixture distribution.
- Parameters:
- mixtDist
Mixture
The mixture distribution.
- mixtDist
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.
- setParallel(flag)¶
Accessor to the parallel flag.
- Parameters:
- flagbool
Logical value telling if the classification and grading are done in parallel.