Changeset 950
- Timestamp:
- Oct 9, 2007, 1:09:58 AM (15 years ago)
- Location:
- trunk/yat/classifier
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/classifier/NBC.cc
r948 r950 73 73 } 74 74 catch (std::bad_cast) { 75 std::string str = "Error in NBC::make_classifier: DataLookup2D of unexpected class."; 75 std::string str = 76 "Error in NBC::make_classifier: DataLookup2D of unexpected class."; 76 77 throw std::runtime_error(str); 77 78 } … … 121 122 const MatrixLookupWeighted* w = 122 123 dynamic_cast<const MatrixLookupWeighted*>(&x); 123 124 124 125 // each row in prediction corresponds to a sample label (class) 125 126 prediction.resize(centroids_.columns(), x.columns(), 0); -
trunk/yat/classifier/SVM.cc
r865 r950 116 116 { 117 117 SVM* sc=0; 118 try { 119 const KernelLookup& kernel = dynamic_cast<const KernelLookup&>(data); 120 assert(data.rows()==data.columns()); 121 assert(data.columns()==target.size()); 122 sc = new SVM(kernel,target); 123 118 const KernelLookup& kernel = dynamic_cast<const KernelLookup&>(data); 119 assert(data.rows()==data.columns()); 120 assert(data.columns()==target.size()); 121 sc = new SVM(kernel,target); 122 124 123 //Copy those variables possible to modify from outside 125 124 // Peter, in particular C 126 } 127 catch (std::bad_cast) { 128 std::cerr << "Warning: SVM::make_classifier only takes KernelLookup" 129 << std::endl; 130 } 125 131 126 return sc; 132 127 } … … 144 139 void SVM::predict(const DataLookup2D& input, utility::matrix& prediction) const 145 140 { 146 // Peter, should check success of dynamic_cast147 141 const KernelLookup& input_kernel = dynamic_cast<const KernelLookup&>(input); 148 142
Note: See TracChangeset
for help on using the changeset viewer.