Changeset 521


Ignore:
Timestamp:
Feb 22, 2006, 4:41:55 PM (16 years ago)
Author:
Peter
Message:

extended target and ensemble tests

Location:
trunk/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/ensemble_test.cc

    r518 r521  
    4747  is.close();
    4848
    49   is.open("data/nm_alpha_linear_matlab.txt");
    50   gslapi::vector alpha_matlab(is);
    51   is.close();
    52 
    5349  classifier::KernelLookup kernel_lookup(kernel);
    5450  classifier::SVM svm(kernel_lookup, target);
    5551  classifier::CrossSplitter cv(target,kernel_lookup, 3, 3);
     52  classifier::EnsembleBuilder ensemble(svm,cv);
     53  ensemble.build();
    5654 
    5755  delete kf;
  • trunk/test/target_test.cc

    r514 r521  
    4343    }
    4444  }
     45  std::vector<size_t> sub;
     46  sub.push_back(2);
     47  sub.push_back(1);
     48  classifier::Target sub_target(target3,sub);
     49  if (target3(sub[0])!=sub_target(0) || target3(sub[1])!=sub_target(1)){
     50    ok = false;
     51    *error << "error in constructor Target(const Target&, std::vector<size_t>&)"
     52           << "\nclasses are not preserved" << std::endl;
     53  }
     54  if (target3.binary(sub[0])!=sub_target.binary(0) ||
     55      target3.binary(sub[1])!=sub_target.binary(1)){
     56    ok = false;
     57    *error << "error in constructor Target(const Target&, std::vector<size_t>&)"
     58           << "\nbinary classes are not preserved" << std::endl;
     59  }
     60
     61
    4562  std::vector<std::string> label(31,"negative");
    4663  for (size_t i=0; i<16; i++)
Note: See TracChangeset for help on using the changeset viewer.