Ignore:
Timestamp:
May 4, 2006, 5:08:42 PM (17 years ago)
Author:
Markus Ringnér
Message:

Added class for in-group-proportions score. Removed gslapi::vector dependence on DataLookup1D by adding classifier::utility functions. Added operator[] to Target and DataLookup1D

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/c++_tools/classifier/Target.h

    r520 r581  
    7979   
    8080    ///
     81    /// @return vector of labels for classes
     82    ///
     83    inline const std::vector<std::string>& labels() { return labels_; }
     84
     85    ///
    8186    /// Binary target for each sample with class @a i is set to @a
    8287    /// b. Default is binary set to false for each class except class
     
    97102
    98103    ///
     104    /// @return number of samples with class @a cl
     105    ///
     106    const size_t size(size_t cl) const;
     107
     108
     109    ///
    99110    /// @return the class of @a sample
    100111    ///
    101112    inline size_t operator()(const size_t sample) const
    102113    { assert(sample<size()); return classes_[sample]; }
     114   
     115    ///
     116    /// @return the class of @a sample
     117    ///
     118    inline size_t operator[](const size_t sample) const
     119    { return this->operator()(sample); }
    103120
    104121
     
    107124    std::vector<char> binary_; // avoid using vector<bool>
    108125    std::vector<size_t> classes_; // class of sample i
    109     std::map<std::string,size_t> class_map_; 
     126    // map between class label and class index
     127    std::map<std::string,size_t> class_map_; 
    110128    std::vector<std::string> labels_; // label of class i
    111129   
Note: See TracChangeset for help on using the changeset viewer.