Changeset 233
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/WeNNI.cc
r228 r233 15 15 WeNNI::WeNNI(const gslapi::matrix& matrix,const gslapi::matrix& flag, 16 16 const u_int neighbours) 17 : NNI(matrix,flag,neighbours) 17 : NNI(matrix,flag,neighbours), imputed_data_raw_(matrix) 18 18 { 19 19 //estimate(); … … 34 34 sort(distance.begin(),distance.end(), 35 35 pair_value_compare<u_int,double>()); 36 bool row_imputed=true; 36 37 for (unsigned int j=0; j<data_.columns(); j++) { 37 38 vector<u_int> knn=nearest_neighbours(j,distance); … … 47 48 } 48 49 // No impute if no contributions from neighbours. 49 if (norm) 50 if (norm){ 51 imputed_data_raw_(i,j) = new_value/norm; 50 52 imputed_data_(i,j)= 51 weight_(i,j)*data_(i,j) + (1-weight_(i,j)) * new_value/norm; 53 weight_(i,j)*data_(i,j) + (1-weight_(i,j))* imputed_data_raw_(i,j); 54 } 52 55 else 53 not_imputed_.push_back(i);56 row_imputed=false; 54 57 } 58 if (!row_imputed) 59 not_imputed_.push_back(i); 55 60 } 56 61 return not_imputed_.size(); -
trunk/src/WeNNI.h
r228 r233 40 40 u_int estimate(void); 41 41 42 /// 43 /// @return A const reference to. 44 /// 45 const gslapi::matrix& imputed_data_raw(void) const 46 { return imputed_data_raw_; } 47 48 49 42 50 private: 43 51 44 52 gslapi::matrix imputed_data_raw_; 45 53 }; 46 54
Note: See TracChangeset
for help on using the changeset viewer.