Ignore:
Timestamp:
Jun 15, 2004, 11:40:52 AM (19 years ago)
Author:
Peter
Message:

Fixed bug in interface between InputRanker? & ROC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/InputRanker.cc

    r89 r102  
    1616InputRanker::InputRanker(const gslapi::matrix& data,
    1717                         const gslapi::vector& target,
    18                          const std::vector<size_t> train_set)
     18                         const std::vector<size_t>& train_set)
    1919  :train_set_(train_set),
    2020   id_(std::vector<size_t>(data.rows())),
     
    3030  size_t nof_genes = data_transposed.rows();
    3131  size_t nof_samples = data_transposed.columns();
    32   if (!train_set_.size())
     32  if (!train_set_.size()){
     33    train_set_.resize(nof_samples);
    3334    for (size_t i=0; i<nof_samples; i++)
    34       train_set_.push_back(i)
    35 
    36   //scoring each gene
     35      train_set_[i]=i
     36  }
     37  //scoring each input
    3738  std::vector<pair<size_t, double> > score;
    38   for (size_t i=0; i<nof_genes; i++){
    39     ROC roc(data_transposed[train_set_[i]], target);
    40     std::pair<size_t, double> tmp(i,roc.area());
     39  ROC roc = ROC();
     40  for (size_t i=0; i<nof_genes; i++){
     41    double area = roc.score(data_transposed[i], target); 
     42    std::pair<size_t, double> tmp(i,area);
    4143    score.push_back(tmp);
    4244  }
     
    4749  for (size_t i=0; i<nof_genes; i++){
    4850    id_[i]=score[i].first;
    49     rank_[id_[i]]=i;
     51    rank_[id_[i]]=i;           
    5052  }
     53}
    5154 
    52  
    53 }
    54 
    5555}} // of namespace cpptools and namespace theplu
Note: See TracChangeset for help on using the changeset viewer.