| 137 | } |
| 138 | |
| 139 | decision_function<linear_kernel<matrix<double,0,1> > > get_decision_function ( |
| 140 | ) const |
| 141 | { |
| 142 | // make sure requires clause is not broken |
| 143 | DLIB_ASSERT(get_w().size() != 0, |
| 144 | "\t decision_function rls::get_decision_function()" |
| 145 | << "\n\t invalid arguments were given to this function" |
| 146 | << "\n\t get_w().size(): " << get_w().size() |
| 147 | << "\n\t this: " << this |
| 148 | ); |
| 149 | |
| 150 | decision_function<linear_kernel<matrix<double,0,1> > > df; |
| 151 | df.alpha.set_size(1); |
| 152 | df.basis_vectors.set_size(1); |
| 153 | df.b = 0; |
| 154 | df.alpha = 1; |
| 155 | df.basis_vectors(0) = w; |
| 156 | |
| 157 | return df; |
| 158 | } |
| 159 | |
| 160 | friend inline void serialize(const rls& item, std::ostream& out) |
| 161 | { |