SHOGUN  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
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 
00066         virtual void ensure_valid(const char* context=NULL);
00067 
00072         virtual ELabelType get_label_type() const;
00073 
00079         CBinaryLabels* get_binary_for_class(int32_t i);
00080 
00087         SGVector<float64_t> get_unique_labels();
00088 
00095         int32_t get_num_classes();
00096 
00102         SGVector<float64_t> get_multiclass_confidences(int32_t i);
00103 
00111         void set_multiclass_confidences(int32_t i, SGVector<float64_t> confidences);
00112 
00119         void allocate_confidences_for(int32_t n_classes);
00120 
00122         virtual const char* get_name() const { return "MulticlassLabels"; }
00123 
00124     private:
00126         void init();
00127 
00128     protected:
00129 
00131         SGMatrix<float64_t> m_multiclass_confidences;
00132 };
00133 }
00134 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation