Changeset 823 for trunk/yat/classifier


Ignore:
Timestamp:
Mar 19, 2007, 12:03:27 PM (14 years ago)
Author:
Peter
Message:

BootstrapSampler?. Fixes #134

Location:
trunk/yat/classifier
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/classifier/CrossValidationSampler.cc

    r680 r823  
    3838                                                 const size_t N,
    3939                                                 const size_t k)
    40     : Sampler(target), k_(k)
     40    : Sampler(target, N), k_(k)
    4141  {
    4242    assert(target.size()>1);
  • trunk/yat/classifier/CrossValidationSampler.h

    r767 r823  
    2929namespace theplu {
    3030namespace yat {
    31 namespace classifier { 
     31namespace classifier {
    3232
    3333  class Target;
     
    4242  /// samples are shuffled and... In total there are N partitions, in
    4343  /// other words, each sample is in validation roughly N/k
    44   /// 
    45   class CrossValidationSampler : public Sampler
    46   {
    47  
    48   public:
    49     ///
    50     /// @brief Constructor
    51     /// 
     44  ///
     45  class CrossValidationSampler : public Sampler
     46  {
     47
     48  public:
     49    ///
     50    /// @brief Constructor
     51    ///
    5252    /// @a target targets.   
    5353    /// @a N total number of partitions.
  • trunk/yat/classifier/Makefile.am

    r675 r823  
    2424noinst_LTLIBRARIES = libclassifier.la
    2525libclassifier_la_SOURCES = \
     26  BootstrapSampler.cc \
    2627  ConsensusInputRanker.cc \
    2728  CrossValidationSampler.cc \
     
    6061
    6162include_classifier_HEADERS = \
     63  BootstrapSampler.h \
    6264  ConsensusInputRanker.h \
    6365  CrossValidationSampler.h \
  • trunk/yat/classifier/Sampler.cc

    r720 r823  
    2929namespace classifier { 
    3030
    31   Sampler::Sampler(const Target& target)
     31  Sampler::Sampler(const Target& target, size_t N)
    3232    : target_(target)
    3333  {
     34    training_index_.reserve(N);
     35    training_target_.reserve(N);
     36    validation_index_.reserve(N);
     37    validation_target_.reserve(N);
    3438  }
    3539
  • trunk/yat/classifier/Sampler.h

    r767 r823  
    3636  /// @brief Interface class for dividing samples into training and
    3737  /// validation.
    38   ///   
     38  ///   
    3939
    40   class Sampler
    41   {
    42  
    43   public:
    44     ///
    45     /// @brief Constructor
    46     /// 
     40  class Sampler
     41  {
     42
     43  public:
     44    ///
     45    /// @brief Constructor
     46    ///
    4747    /// @param target used to balance partitions
     48    /// @param Number of partitions
    4849    ///
    49     Sampler(const Target& target);
     50    Sampler(const Target& target, size_t N);
    5051
    5152    ///
Note: See TracChangeset for help on using the changeset viewer.