@@ -405,16 +405,17 @@ void journalPaperExperiments(vector<SVector<bool>*>& vectors) {
405
405
// run TSVQ vs EM-tree convergence
406
406
if (true ) {
407
407
int depth = 3 , m = 10 ;
408
- int iterRange = 10 ; // test RMSE at 1 to maxiters iterations
408
+ int iterRange = 100 ; // test RMSE at 1 to maxiters iterations
409
+ int seed = 1234 ; // start with same seed each time
409
410
410
411
// TSVQ
411
412
if (true ) {
412
413
vector<double > rmse;
413
414
vector<int > clusters;
414
415
vector<double > seconds;
415
416
for (int maxiters = 1 ; maxiters <= iterRange; ++maxiters) {
417
+ srand (seed);
416
418
boost::timer::auto_cpu_timer all;
417
- srand (1234 );
418
419
TSVQ<vecType, clustererType, distanceType, protoType> tsvq (m, depth, maxiters);
419
420
tsvq.cluster (vectors);
420
421
all.stop ();
@@ -431,6 +432,7 @@ void journalPaperExperiments(vector<SVector<bool>*>& vectors) {
431
432
432
433
// EM-tree
433
434
if (true ) {
435
+ cout << " EM-tree convergence" << endl;
434
436
vector<double > rmse;
435
437
vector<int > clusters;
436
438
vector<double > seconds;
@@ -439,8 +441,8 @@ void journalPaperExperiments(vector<SVector<bool>*>& vectors) {
439
441
for (int i = 0 ; i < depth - 1 ; ++i) {
440
442
splits.push_back (m);
441
443
}
444
+ srand (seed);
442
445
boost::timer::auto_cpu_timer all;
443
- srand (1234 );
444
446
EMTree<vecType, clustererType, distanceType, protoType> emt (m);
445
447
// seeding does first iteration
446
448
emt.seedSingleThreaded (vectors, splits);
@@ -533,7 +535,7 @@ void journalPaperExperiments(vector<SVector<bool>*>& vectors) {
533
535
}
534
536
535
537
// run kmeans exerpiments
536
- if (true ) {
538
+ if (false ) {
537
539
int maxiters = 1000 ;
538
540
cout << " k-means maxiters=" << maxiters << endl;
539
541
vector<double > rmse;
@@ -559,9 +561,9 @@ void journalPaperExperiments(vector<SVector<bool>*>& vectors) {
559
561
}
560
562
561
563
// run K-tree experiments
562
- if (false ) {
564
+ if (true ) {
563
565
// build tree
564
- vector<int > orders = {10000 , 5000 , 2500 , 1000 , 750 , 500 , 400 , 300 , 250 , 200 , 150 , 100 , 75 , 50 , 25 };
566
+ vector<int > orders = {100 }; // { 10000, 5000, 2500, 1000, 750, 500, 400, 300, 250, 200, 150, 100, 75, 50, 25};
565
567
for (int m : orders) {
566
568
const int maxiters = 1000 ;
567
569
cout << " -----" << endl;
0 commit comments