summaryrefslogtreecommitdiff
path: root/dtrain/sample.h
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2011-09-09 15:33:35 +0200
committerPatrick Simianer <p@simianer.de>2011-09-23 19:13:58 +0200
commitedb0cc0cbae1e75e4aeedb6360eab325effe6573 (patch)
treea2fed4614b88f177f91e88fef3b269fa75e80188 /dtrain/sample.h
parent2e6ef7cbec77b22ce3d64416a5ada3a6c081f9e2 (diff)
partial merge, ruleid feature
Diffstat (limited to 'dtrain/sample.h')
-rw-r--r--dtrain/sample.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/dtrain/sample.h b/dtrain/sample.h
index b6aa9abd..502901af 100644
--- a/dtrain/sample.h
+++ b/dtrain/sample.h
@@ -37,20 +37,20 @@ sample_all( KBestList* kb, TrainingInstances &training )
}
void
-sample_all_rand( KBestList* kb, TrainingInstances &training )
+sample_rand( KBestList* kb, TrainingInstances &training )
{
srand( time(NULL) );
for ( size_t i = 0; i < kb->GetSize()-1; i++ ) {
for ( size_t j = i+1; j < kb->GetSize(); j++ ) {
if ( rand() % 2 ) {
- TPair p;
- p.first = kb->feats[i];
- p.second = kb->feats[j];
- p.first_rank = i;
- p.second_rank = j;
- p.first_score = kb->scores[i];
- p.second_score = kb->scores[j];
- training.push_back( p );
+ TPair p;
+ p.first = kb->feats[i];
+ p.second = kb->feats[j];
+ p.first_rank = i;
+ p.second_rank = j;
+ p.first_score = kb->scores[i];
+ p.second_score = kb->scores[j];
+ training.push_back( p );
}
}
}