Skip to content

Commit

Permalink
Added doxygen comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ptillet committed Apr 12, 2012
1 parent 04677a7 commit 3255541
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/shogun/classifier/NearestCentroid.cpp
Expand Up @@ -43,7 +43,7 @@ namespace shogun{

void CNearestCentroid::store_model_features()
{

distance->init(m_centroids,distance->get_rhs());
}

bool CNearestCentroid::train_machine(CFeatures* data)
Expand Down Expand Up @@ -106,9 +106,6 @@ namespace shogun{

m_centroids->free_feature_matrix();
m_centroids->set_feature_matrix(centroids,num_feats,num_classes);


distance->init(m_centroids,distance->get_rhs());

m_is_trained=true;

Expand Down
17 changes: 16 additions & 1 deletion src/shogun/classifier/NearestCentroid.h
Expand Up @@ -64,7 +64,11 @@ class CNearestCentroid : public CDistanceMachine{
float64_t get_shrinking() const{
return m_shrinking;
}


/** Get the centroids
*
* @return Matrix containing the centroids
*/
CSimpleFeatures<float64_t>* get_centroids() const{
return m_centroids;
}
Expand All @@ -80,15 +84,26 @@ class CNearestCentroid : public CDistanceMachine{
*/
virtual bool train_machine(CFeatures* data=NULL);

/** Stores feature data of underlying model.
*
* Sets centroids as lhs
*/
virtual void store_model_features();

private:
void init();

protected:
/// number of classes (i.e. number of values labels can take)
int32_t m_num_classes;

/// Shrinking parameter
float64_t m_shrinking;

/// The centroids of the trained features
CSimpleFeatures<float64_t>* m_centroids;

/// Tells if the classifier has been trained or not
bool m_is_trained;
};

Expand Down

0 comments on commit 3255541

Please sign in to comment.