NPclassify2< FLOAT > Class Template Reference

Non parametric classifier version 2.0. More...

#include <VFAT/NPclassify2.H>

Collaboration diagram for NPclassify2< FLOAT >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 NPclassify2 (readConfig &settings, readConfig &polySet, bool commandLineSettings=false)
 create object with readConfig as defaults
void NPsetup (readConfig &settings, readConfig &polySet, bool commandLineSettings=false)
 input command line settings for some variables insted of using .conf
void NPinputCommandLineSettings (FLOAT inVals[31])
void NPresizeSpace (int samples, int dim)
 resizes all vectors if more space is added
void NPaddPoint (std::vector< int > point)
 add a point to the space
void NPaddSpace (typename std::vector< std::vector< FLOAT > > &space)
 add whole space (concatinates if data is there)
void NPechoSpace ()
 echo the space you are working in
void NPresetSpace (int features, int dims)
 reset the dataset to empty (does not resize vectors)
void NPresetSpace ()
 reset the dataset to empty (does not resize vectors)
void NPsetConvolveBias (std::vector< covHolder< double > > *ch, int listSize, FLOAT bias)
 bias the convolution of space with prior densities
void NPclassifySpaceNew (bool doBias)
 classify space based upon rules given, for the first time
FLOAT NPclassifySpaceKmeans (unsigned int *K, FLOAT *minDiff, unsigned int *stopIter)
 ulternativly use Kmeans to classify space, return error
void NPclassifySpacePartial ()
 classify space in subsequent iterations
int NPgetStemNumber ()
 return how many stems there are (how many classes)
int NPgetStemNumberEdit ()
 return how many stems there are (how many classes)
FLOAT NPgetMaxDensity ()
 return the max density value
FLOAT NPgetMeanDensity ()
 return the mean density
FLOAT NPgetStdDensity ()
 get the Standard Deviation of density
std::vector< FLOAT > * NPgetMeanClassDensity ()
 return the Mean Density per inter group
std::vector< FLOAT > * NPgetStdClassDensity ()
 return the Standard Deviation per inter group
FLOAT NPgetEntropy ()
 get a measure of entropy as measured with density as P
bool NPisLowDensity (int item)
 return if this point is a low density point
bool NPisStem (int item)
 returns if this item is a stem
std::vector< FLOAT > NPgetDensity ()
 return density weight map (linear)
std::vector< FLOAT > * NPgetDensityPtr ()
 return density weight map (linear)
std::vector< int * > NPgetStems ()
 Returns a vector of all class parents.
int NPgetClassSize (int _Class)
 Return how many points/vectors are in class n (1... n).
int NPgetMinClassSize ()
 return what is set as the minimum class size
std::vector< std::vector< int * > > * NPgetClass ()
 Return the who map for the class list as a FLOAT nested vector.
std::vector< int * > NPgetClass (int _Class)
 Return class n as a vector (Set of all points/vectors in this class).
int NPgetClass (int _Class, int item)
 Return item n from class m.
FLOAT NPgetFeature (int m_feature_index, int n_vector_index)
 Return feature m of vector n.
std::vector< int * > NPgetParents ()
 returns parents
std::vector< std::vector< int * > > NPgetChildren ()
 Returns a vector of all decendants (children, grandchildren) or all nodes.
std::vector< std::vector< int > > NPgetBoundingBoxes (bool ignore)
 calculate and return simple bounding boxes for classes
void NPdrawBoundingBoxes (std::vector< std::vector< int > > *BB, Image< PixRGB< FLOAT > > *ibox, int offsetX, int offsetY, PixRGB< FLOAT > pix, bool ignorMin)
 draw the bounding boxes to an image for you from NPgetBoundingBoxes
void NPmetaClassify (int objects)
 analyze classification stratagy. create meta classifier
void NPdumpLinkInfo (std::string fileName)
 dump stats to files about the links for analysis purposes
FLOAT NPgaussKernel (FLOAT x, FLOAT mu, FLOAT sig) const
 gaussian kernel
FLOAT NPgaussKernel (FLOAT z) const
 gaussian kernel with mu = 0 and sig = 1.0
FLOAT NPsigmoidKernel (FLOAT beta, FLOAT v) const
 sigmoid kernel

Public Attributes

int NP_doLinkMap
int NP_doDensityMap
int NP_doClassMap
int NP_usePolySet

Detailed Description

template<class FLOAT>
class NPclassify2< FLOAT >

Non parametric classifier version 2.0.

When called this class will attempt to classify all data provided into an unknown number of classed. Thus, NPclassify is ment to work the same as other classifiers such as EM and Kmeans but without strong priors about class number or size. Soft parameters are used and are either provied at command line or in a configuration file

Definition at line 68 of file NPclassify2.H.


Constructor & Destructor Documentation

template<class FLOAT >
NPclassify2< FLOAT >::NPclassify2 ( readConfig settings,
readConfig polySet,
bool  commandLineSettings = false 
) [inline]

create object with readConfig as defaults

Definition at line 78 of file NPclassify2.C.

References NPclassify2< FLOAT >::NPsetup().


Member Function Documentation

template<class FLOAT >
void NPclassify2< FLOAT >::NPaddPoint ( std::vector< int >  point  )  [inline]

add a point to the space

Definition at line 205 of file NPclassify2.C.

template<class FLOAT>
void NPclassify2< FLOAT >::NPaddSpace ( typename std::vector< std::vector< FLOAT > > &  space  )  [inline]

add whole space (concatinates if data is there)

Parameters:
space This is a set of feature vectors as a vector of vectors
sSize This is how many elements you are adding leave blank if \ the number of elements equals the vector size

Definition at line 213 of file NPclassify2.C.

Referenced by main(), and segmentImageMerge2::SIMclusterColor().

template<class FLOAT>
FLOAT NPclassify2< FLOAT >::NPclassifySpaceKmeans ( unsigned int *  K,
FLOAT *  minDiff,
unsigned int *  stopIter 
) [inline]

ulternativly use Kmeans to classify space, return error

Parameters:
K the number of classes to find
minDiff the minimum difference between errors on which to stop
stopIter the maximum number of iterations to run

Definition at line 362 of file NPclassify2.C.

References sqrt().

Referenced by main().

template<class FLOAT >
void NPclassify2< FLOAT >::NPclassifySpaceNew ( bool  doBias = true  )  [inline]

classify space based upon rules given, for the first time

Definition at line 302 of file NPclassify2.C.

References Timer::get(), and Timer::reset().

Referenced by main(), and segmentImageMerge2::SIMclusterColor().

template<class FLOAT >
void NPclassify2< FLOAT >::NPclassifySpacePartial (  )  [inline]

classify space in subsequent iterations

Definition at line 479 of file NPclassify2.C.

template<class FLOAT>
void NPclassify2< FLOAT >::NPdrawBoundingBoxes ( std::vector< std::vector< int > > *  BB,
Image< PixRGB< FLOAT > > *  ibox,
int  offsetX,
int  offsetY,
PixRGB< FLOAT >  pix,
bool  ignorMin 
) [inline]

draw the bounding boxes to an image for you from NPgetBoundingBoxes

Definition at line 712 of file NPclassify2.C.

References NPclassify2< FLOAT >::NPgetClassSize(), NPclassify2< FLOAT >::NPgetMinClassSize(), and NPclassify2< FLOAT >::NPgetStemNumber().

Referenced by main().

template<class FLOAT >
void NPclassify2< FLOAT >::NPdumpLinkInfo ( std::string  fileName  )  [inline]

dump stats to files about the links for analysis purposes

Definition at line 829 of file NPclassify2.C.

template<class FLOAT >
void NPclassify2< FLOAT >::NPechoSpace (  )  [inline]

echo the space you are working in

Definition at line 222 of file NPclassify2.C.

template<class FLOAT>
FLOAT NPclassify2< FLOAT >::NPgaussKernel ( FLOAT  z  )  const [inline]

gaussian kernel with mu = 0 and sig = 1.0

Definition at line 1977 of file NPclassify2.C.

References sqrt().

template<class FLOAT>
FLOAT NPclassify2< FLOAT >::NPgaussKernel ( FLOAT  x,
FLOAT  mu,
FLOAT  sig 
) const [inline]

gaussian kernel

Definition at line 1968 of file NPclassify2.C.

References sqrt().

template<class FLOAT >
std::vector< std::vector< int > > NPclassify2< FLOAT >::NPgetBoundingBoxes ( bool  ignore  )  [inline]

calculate and return simple bounding boxes for classes

Definition at line 668 of file NPclassify2.C.

Referenced by main().

template<class FLOAT >
std::vector< std::vector< int * > > NPclassify2< FLOAT >::NPgetChildren (  )  [inline]

Returns a vector of all decendants (children, grandchildren) or all nodes.

Definition at line 660 of file NPclassify2.C.

Referenced by main().

template<class FLOAT >
int NPclassify2< FLOAT >::NPgetClass ( int  _Class,
int  item 
) [inline]

Return item n from class m.

Definition at line 631 of file NPclassify2.C.

References ASSERT.

template<class FLOAT >
std::vector< int * > NPclassify2< FLOAT >::NPgetClass ( int  _Class  )  [inline]

Return class n as a vector (Set of all points/vectors in this class).

Definition at line 622 of file NPclassify2.C.

References ASSERT.

template<class FLOAT >
std::vector< std::vector< int * > > * NPclassify2< FLOAT >::NPgetClass (  )  [inline]

Return the who map for the class list as a FLOAT nested vector.

Definition at line 614 of file NPclassify2.C.

Referenced by main(), and segmentImageMerge2::SIMclusterColor().

template<class FLOAT >
int NPclassify2< FLOAT >::NPgetClassSize ( int  _Class  )  [inline]

Return how many points/vectors are in class n (1... n).

Definition at line 597 of file NPclassify2.C.

References ASSERT.

Referenced by main(), NPclassify2< FLOAT >::NPdrawBoundingBoxes(), NPclassify2< FLOAT >::NPgetStemNumberEdit(), and segmentImageMerge2::SIMclusterColor().

template<class FLOAT >
std::vector< FLOAT > NPclassify2< FLOAT >::NPgetDensity (  )  [inline]

return density weight map (linear)

Definition at line 573 of file NPclassify2.C.

Referenced by main().

template<class FLOAT >
std::vector< FLOAT > * NPclassify2< FLOAT >::NPgetDensityPtr (  )  [inline]

return density weight map (linear)

Definition at line 581 of file NPclassify2.C.

template<class FLOAT >
FLOAT NPclassify2< FLOAT >::NPgetEntropy (  )  [inline]

get a measure of entropy as measured with density as P

Definition at line 549 of file NPclassify2.C.

template<class FLOAT >
FLOAT NPclassify2< FLOAT >::NPgetFeature ( int  m_feature_index,
int  n_vector_index 
) [inline]

Return feature m of vector n.

Definition at line 641 of file NPclassify2.C.

References ASSERT.

Referenced by main(), and segmentImageMerge2::SIMclusterColor().

template<class FLOAT >
FLOAT NPclassify2< FLOAT >::NPgetMaxDensity (  )  [inline]

return the max density value

Definition at line 509 of file NPclassify2.C.

Referenced by main().

template<class FLOAT >
std::vector< FLOAT > * NPclassify2< FLOAT >::NPgetMeanClassDensity (  )  [inline]

return the Mean Density per inter group

Definition at line 533 of file NPclassify2.C.

template<class FLOAT >
FLOAT NPclassify2< FLOAT >::NPgetMeanDensity (  )  [inline]

return the mean density

Definition at line 517 of file NPclassify2.C.

template<class FLOAT >
int NPclassify2< FLOAT >::NPgetMinClassSize (  )  [inline]

return what is set as the minimum class size

Definition at line 606 of file NPclassify2.C.

Referenced by main(), NPclassify2< FLOAT >::NPdrawBoundingBoxes(), and NPclassify2< FLOAT >::NPgetStemNumberEdit().

template<class FLOAT >
std::vector< int * > NPclassify2< FLOAT >::NPgetParents (  )  [inline]

returns parents

Definition at line 652 of file NPclassify2.C.

Referenced by main().

template<class FLOAT >
std::vector< FLOAT > * NPclassify2< FLOAT >::NPgetStdClassDensity (  )  [inline]

return the Standard Deviation per inter group

Definition at line 541 of file NPclassify2.C.

template<class FLOAT >
FLOAT NPclassify2< FLOAT >::NPgetStdDensity (  )  [inline]

get the Standard Deviation of density

Definition at line 525 of file NPclassify2.C.

template<class FLOAT >
int NPclassify2< FLOAT >::NPgetStemNumber (  )  [inline]

return how many stems there are (how many classes)

Definition at line 485 of file NPclassify2.C.

Referenced by main(), NPclassify2< FLOAT >::NPdrawBoundingBoxes(), NPclassify2< FLOAT >::NPgetStemNumberEdit(), and segmentImageMerge2::SIMclusterColor().

template<class FLOAT >
int NPclassify2< FLOAT >::NPgetStemNumberEdit (  )  [inline]

return how many stems there are (how many classes)

account for classes that are too small

Definition at line 493 of file NPclassify2.C.

References min(), NPclassify2< FLOAT >::NPgetClassSize(), NPclassify2< FLOAT >::NPgetMinClassSize(), and NPclassify2< FLOAT >::NPgetStemNumber().

template<class FLOAT >
std::vector< int * > NPclassify2< FLOAT >::NPgetStems (  )  [inline]

Returns a vector of all class parents.

Definition at line 589 of file NPclassify2.C.

Referenced by main().

template<class FLOAT >
bool NPclassify2< FLOAT >::NPisLowDensity ( int  item  )  [inline]

return if this point is a low density point

Definition at line 557 of file NPclassify2.C.

template<class FLOAT >
bool NPclassify2< FLOAT >::NPisStem ( int  item  )  [inline]

returns if this item is a stem

Definition at line 565 of file NPclassify2.C.

template<class FLOAT >
void NPclassify2< FLOAT >::NPmetaClassify ( int  objects  )  [inline]

analyze classification stratagy. create meta classifier

Definition at line 744 of file NPclassify2.C.

template<class FLOAT >
void NPclassify2< FLOAT >::NPresetSpace (  )  [inline]

reset the dataset to empty (does not resize vectors)

Definition at line 264 of file NPclassify2.C.

template<class FLOAT >
void NPclassify2< FLOAT >::NPresetSpace ( int  features,
int  dims 
) [inline]

reset the dataset to empty (does not resize vectors)

Definition at line 236 of file NPclassify2.C.

Referenced by main(), and segmentImageMerge2::SIMclusterColor().

template<class FLOAT >
void NPclassify2< FLOAT >::NPresizeSpace ( int  samples,
int  dim 
) [inline]

resizes all vectors if more space is added

Holds the total number of decendants for a node in this class

Definition at line 1865 of file NPclassify2.C.

Referenced by main(), and segmentImageMerge2::SIMSetCluster().

template<class FLOAT>
void NPclassify2< FLOAT >::NPsetConvolveBias ( std::vector< covHolder< double > > *  ch,
int  listSize,
FLOAT  bias 
) [inline]

bias the convolution of space with prior densities

Definition at line 288 of file NPclassify2.C.

template<class FLOAT >
void NPclassify2< FLOAT >::NPsetup ( readConfig settings,
readConfig polySet,
bool  commandLineSettings = false 
) [inline]

input command line settings for some variables insted of using .conf

Definition at line 99 of file NPclassify2.C.

References readConfig::getItemValueF().

Referenced by NPclassify2< FLOAT >::NPclassify2(), and segmentImageMerge2::SIMSetCluster().

template<class FLOAT>
FLOAT NPclassify2< FLOAT >::NPsigmoidKernel ( FLOAT  beta,
FLOAT  v 
) const [inline]

sigmoid kernel

Definition at line 1984 of file NPclassify2.C.


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:37 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3