Changeset 779 for trunk/yat/classifier


Ignore:
Timestamp:
Mar 5, 2007, 7:58:30 PM (14 years ago)
Author:
Peter
Message:

Refs #101

Location:
trunk/yat/classifier
Files:
5 edited

Legend:

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

    r720 r779  
    7878
    7979
     80  double sum_weight(const DataLookupWeighted1D& x)
     81  {
     82    double r=0;
     83    for (size_t i=0; i<x.size(); ++i)
     84      r += x.weight(i);
     85    return r;
     86  }
     87
     88
    8089  double DataLookupWeighted1D::weight(const size_t i) const
    8190  {
  • trunk/yat/classifier/DataLookupWeighted1D.h

    r767 r779  
    105105  };
    106106
     107  ///
     108  /// @return sum of weights
     109  ///
     110  double sum_weight(const DataLookupWeighted1D&);
     111
    107112}}} // of namespace classifier, yat, and theplu
    108113
  • trunk/yat/classifier/InputRanker.cc

    r720 r779  
    2828#include "DataLookupWeighted1D.h"
    2929#include "Target.h"
    30 #include "yat/statistics/ROC.h"
     30#include "yat/statistics/Score.h"
    3131#include "yat/utility/stl_utility.h"
    3232
  • trunk/yat/classifier/utility.cc

    r680 r779  
    2424#include "utility.h"
    2525#include "DataLookup1D.h"
     26#include "DataLookupWeighted1D.h"
    2627#include "yat/utility/vector.h"
    2728
     
    3839  }
    3940
     41  void convert(const DataLookupWeighted1D& lookup, utility::vector& value,
     42               utility::vector& weight)
     43  {
     44   
     45    value=utility::vector(lookup.size());
     46    weight=utility::vector(lookup.size());
     47    for(u_int i=0; i<lookup.size(); i++){
     48      value(i)=lookup.data(i);
     49      weight(i)=lookup.weight(i);
     50    }
     51  }
     52
    4053}}} // of namespace classifier, yat, and theplu
  • trunk/yat/classifier/utility.h

    r680 r779  
    3535
    3636  class DataLookup1D;
     37  class DataLookupWeighted1D;
    3738
    3839  ///
     
    4142  void convert(const DataLookup1D&, utility::vector&);
    4243
     44  ///
     45  /// Converts a DataLookupWeighted1D to two utility::vector
     46  ///
     47  void convert(const DataLookupWeighted1D&, utility::vector& value,
     48               utility::vector& weight);
     49
    4350}}} // of namespace classifier, yat, and theplu
    4451
Note: See TracChangeset for help on using the changeset viewer.