Changeset 233 for trunk/src/WeNNI.cc
- Timestamp:
- Feb 21, 2005, 3:52:30 PM (18 years ago)
- File:
-
- 1 edited
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();
Note: See TracChangeset
for help on using the changeset viewer.