00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2012 Chiyuan Zhang 00008 * Copyright (C) 2012 Chiyuan Zhang 00009 */ 00010 00011 #include <shogun/multiclass/ecoc/ECOCOVREncoder.h> 00012 00013 using namespace shogun; 00014 00015 SGMatrix<int32_t> CECOCOVREncoder::create_codebook(int32_t num_classes) 00016 { 00017 SGMatrix<int32_t> code_book(num_classes, num_classes, true); 00018 code_book.set_const(-1); 00019 for (int32_t i=0; i < num_classes; ++i) 00020 code_book(i, i) = 1; 00021 00022 return code_book; 00023 }