Changeset 1013 for trunk/yat/classifier


Ignore:
Timestamp:
Feb 1, 2008, 4:34:30 PM (13 years ago)
Author:
Markus Ringnér
Message:

Adding functionality tests for NCC

Location:
trunk/yat/classifier
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/classifier/NCC.h

    r1007 r1013  
    215215      }
    216216    }
    217     trained_=true;
    218     return trained_;
     217    return true;
    219218  }
    220219
     
    223222                              utility::matrix& prediction) const
    224223  {   
    225     utility::yat_assert<std::runtime_error>(data_.rows()==test.rows());
    226     utility::yat_assert<std::runtime_error>(test.rows()==centroids_->rows());
     224    utility::yat_assert<std::runtime_error>
     225      (centroids_,"NCC::predict called for untrained classifier");
     226    utility::yat_assert<std::runtime_error>
     227      (data_.rows()==test.rows(),
     228       "NCC::predict test data with incorrect number of rows");
    227229   
    228230    prediction.clone(utility::matrix(centroids_->columns(), test.columns()));       
  • trunk/yat/classifier/SVM.cc

    r1009 r1013  
    126126      sc->max_epochs(max_epochs());
    127127    }
    128     catch (std::bad_cast& e) {
     128    catch (std::bad_cast) {
    129129      std::string str =
    130130        "Error in SVM::make_classifier: DataLookup2D of unexpected class.";
     
    169169        prediction(1,i) = -prediction(0,i);
    170170    }
    171     catch (std::bad_cast& e) {
     171    catch (std::bad_cast) {
    172172      std::string str =
    173173        "Error in SVM::predict: DataLookup2D of unexpected class.";
Note: See TracChangeset for help on using the changeset viewer.