MulticlassLabels.h

Go to the documentation of this file.
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) 1999-2009 Soeren Sonnenburg
00008  * Written (W) 1999-2008 Gunnar Raetsch
00009  * Written (W) 2011 Heiko Strathmann
00010  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
00011  */
00012 
00013 #ifndef _MULTICLASS_LABELS__H__
00014 #define _MULTICLASS_LABELS__H__
00015 
00016 #include <shogun/lib/common.h>
00017 #include <shogun/io/File.h>
00018 #include <shogun/labels/LabelTypes.h>
00019 #include <shogun/labels/DenseLabels.h>
00020 #include <shogun/features/SubsetStack.h>
00021 
00022 namespace shogun
00023 {
00024     class CFile;
00025     class CBinaryLabels;
00026     class CMulticlassLabels;
00027     class CDenseLabels;
00028 
00033 class CMulticlassLabels : public CDenseLabels
00034 {
00035     public:
00037         CMulticlassLabels();
00038 
00043         CMulticlassLabels(int32_t num_labels);
00044 
00049         CMulticlassLabels(SGVector<float64_t> src);
00050 
00055         CMulticlassLabels(CFile* loader);
00056 
00058         ~CMulticlassLabels();
00059 
00064         static CMulticlassLabels* obtain_from_generic(CLabels* base_labels);
00065 
00072         virtual void ensure_valid(const char* context=NULL);
00073 
00078         virtual ELabelType get_label_type();
00079 
00085         CBinaryLabels* get_binary_for_class(int32_t i);
00086 
00093         SGVector<float64_t> get_unique_labels();
00094 
00101         int32_t get_num_classes();
00102 
00108         SGVector<float64_t> get_multiclass_confidences(int32_t i);
00109 
00115         void set_multiclass_confidences(int32_t i, SGVector<float64_t> confidences);
00116 
00118         virtual const char* get_name() const { return "MulticlassLabels"; }
00119 
00120     protected:
00121 
00123         SGVector<float64_t>* m_multiclass_confidences;
00124 
00126         int32_t m_num_multiclass_confidences;
00127 };
00128 }
00129 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation