SHOGUN
v3.2.0
|
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/machine/BaseMulticlassMachine.h> 00012 00013 using namespace shogun; 00014 00015 CBaseMulticlassMachine::CBaseMulticlassMachine() 00016 { 00017 m_machines = new CDynamicObjectArray(); 00018 00019 SG_ADD((CSGObject**)&m_machines, "machines", "Machines that jointly make up the multi-class machine.", MS_NOT_AVAILABLE); 00020 } 00021 00022 CBaseMulticlassMachine::~CBaseMulticlassMachine() 00023 { 00024 SG_UNREF(m_machines); 00025 } 00026 00027 int32_t CBaseMulticlassMachine::get_num_machines() const 00028 { 00029 return m_machines->get_num_elements(); 00030 } 00031 00032 EProblemType CBaseMulticlassMachine::get_machine_problem_type() const 00033 { 00034 return PT_MULTICLASS; 00035 } 00036 00037 bool CBaseMulticlassMachine::is_label_valid(CLabels *lab) const 00038 { 00039 return lab->get_label_type() == LT_MULTICLASS; 00040 } 00041