diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2012-04-16 18:20:33 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2012-04-16 18:20:33 -0400 |
commit | 4b38556c88c739de82b9c298261a262ec620280e (patch) | |
tree | 272124012fa38a359a7c0efb1da4499a1b4371b5 /utils/weights.cc | |
parent | f2fcf9e8aa0e5dee75fd08ee915488ec1a741975 (diff) |
rst sampler
Diffstat (limited to 'utils/weights.cc')
-rw-r--r-- | utils/weights.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/weights.cc b/utils/weights.cc index ac407dfb..39c18474 100644 --- a/utils/weights.cc +++ b/utils/weights.cc @@ -144,8 +144,10 @@ void Weights::ShowLargestFeatures(const vector<weight_t>& w) { vector<int> fnums(w.size()); for (int i = 0; i < w.size(); ++i) fnums[i] = i; + int nf = FD::NumFeats(); + if (nf > 10) nf = 10; vector<int>::iterator mid = fnums.begin(); - mid += (w.size() > 10 ? 10 : w.size()); + mid += nf; partial_sort(fnums.begin(), mid, fnums.end(), FComp(w)); cerr << "TOP FEATURES:"; for (vector<int>::iterator i = fnums.begin(); i != mid; ++i) { |