Changeset 2223


Ignore:
Timestamp:
Mar 19, 2010, 4:30:02 AM (12 years ago)
Author:
Peter
Message:

fixes #543

Location:
trunk/yat/classifier
Files:
6 edited

Legend:

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

    r2119 r2223  
    7878    id_.resize(data.rows());
    7979    rank_.resize(data.rows());
    80     for (size_t i=0; i<sampler.size(); ++i){
    81       input_rankers_.push_back(InputRanker(MatrixLookupWeighted(data,sampler.training_index(i), false),
     80    for (size_t i=0; i<sampler.size(); ++i) {
     81      MatrixLookupWeighted mlw(data, utility::Index(data.rows()),
     82                               sampler.training_index(i));
     83      input_rankers_.push_back(InputRanker(mlw,
    8284                                           sampler.training_target(i),
    8385                                           score));       
  • trunk/yat/classifier/FeatureSelector.cc

    r2119 r2223  
    5757  FeatureSelector::get(const MatrixLookupWeighted& matrix)
    5858  {
    59     return MatrixLookupWeighted(matrix, features_, true);
     59    return MatrixLookupWeighted(matrix, features_,
     60                                yat::utility::Index(matrix.columns()));
    6061  }
    6162
  • trunk/yat/classifier/Kernel.cc

    r2210 r2223  
    6767   
    6868    if (other.weighted()){
    69       mlw_ = new MatrixLookupWeighted(*other.mlw_, utility::Index(index),true);
     69      mlw_ = new MatrixLookupWeighted(*other.mlw_, utility::Index(index),
     70                                      utility::Index(other.mlw_->columns()));
    7071      ref_count_w_ = new unsigned int(1);
    7172      ml_=NULL;
  • trunk/yat/classifier/KernelLookup.cc

    r2119 r2223  
    140140  {
    141141    assert(weighted());
    142     return MatrixLookupWeighted(kernel_->data_weighted(),column_index_,false);
     142    using utility::Index; // just to avoid long line
     143    return MatrixLookupWeighted(kernel_->data_weighted(),
     144                                Index(kernel_->data_weighted().rows()),
     145                                column_index_);
    143146  }
    144147
     
    187190    if (kernel_->weighted()){
    188191      const MatrixLookupWeighted* ms =
    189         new MatrixLookupWeighted(data_weighted(),inputs,true);
     192        new MatrixLookupWeighted(data_weighted(),inputs,
     193                                 utility::Index(data_weighted().columns()));
    190194      kernel = kernel_->make_kernel(*ms, true);
    191195    }
  • trunk/yat/classifier/MatrixLookup.h

    r2119 r2223  
    88  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
    99  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
    10   Copyright (C) 2009 Peter Johansson
     10  Copyright (C) 2009, 2010 Peter Johansson
    1111
    1212  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2727
    2828#include "yat/utility/Container2DIterator.h"
     29#include "yat/utility/deprecate.h"
    2930#include "yat/utility/Index.h"
    3031#include "yat/utility/iterator_traits.h"
     
    150151    /// undefined.
    151152    ///
     153    /// \deprecated Provided for backgroundColor compatibility with
     154    /// the 0.6 API. Use MatrixLookup(const utility::Matrix&, const
     155    /// utility::Index&, const utility::Index&)
     156    ///
    152157    MatrixLookup(const utility::Matrix& matrix,
    153158                 const utility::Index& index,
    154                  const bool row_vectors);
     159                 const bool row_vectors) YAT_DEPRECATE;
    155160
    156161    ///
     
    215220    /// undefined.
    216221    ///
     222    /// \deprecated Provided for backgroundColor compatibility with
     223    /// the 0.6 API. Use MatrixLookup(const MatrixLookup&, const
     224    /// utility::Index&, const utility::Index&)
     225    ///
    217226    MatrixLookup(const MatrixLookup& ml, const utility::Index&,
    218227                 const bool row_vectors);
     
    228237    /// @brief The istream constructor.
    229238    ///
    230     /// In construction the underlying matrix is created from
    231     /// stream. The MatrixLookup will be owner of the underlying
     239    /// In construction the underlying utility::Matrix is created from
     240    /// the stream using utility::Matrix(std::istream&). The
     241    /// constructed MatrixLookup will be owner of the underlying
    232242    /// matrix.
    233243    ///
    234     /// @see matrix(istream&) for details.
     244    /// @see Matrix(istream&) for details.
    235245    ///
    236246    MatrixLookup(std::istream&, char sep='\0');
  • trunk/yat/classifier/MatrixLookupWeighted.h

    r2119 r2223  
    77  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
    88  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
    9   Copyright (C) 2009 Peter Johansson
     9  Copyright (C) 2009, 2010 Peter Johansson
    1010
    1111  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2727#include "yat/utility/Container2DIterator.h"
    2828#include "yat/utility/DataWeight.h"
     29#include "yat/utility/deprecate.h"
    2930#include "yat/utility/Index.h"
    3031#include "yat/utility/MatrixWeighted.h"
     
    182183    /// undefined.
    183184    ///
    184     MatrixLookupWeighted(const MatrixLookupWeighted& ml,
     185    /// \deprecated Provided for backward compatibility with the 0.6
     186    /// API. Use MatrixLookupWeighted(const MatrixLookupWeighted&,
     187    /// const utility::Index&, const utility::Index&)
     188    ///
     189    MatrixLookupWeighted(const MatrixLookupWeighted& ml,
    185190                         const utility::Index&,
    186                          const bool row_vectors);
     191                         const bool row_vectors) YAT_DEPRECATE;
    187192
    188193    ///
Note: See TracChangeset for help on using the changeset viewer.