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-2012 Heiko Strathmann 00010 * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society 00011 */ 00012 00013 #ifndef _BINARY_LABELS__H__ 00014 #define _BINARY_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 00021 namespace shogun 00022 { 00023 class CFile; 00024 class CDenseLabels; 00025 00036 class CBinaryLabels : public CDenseLabels 00037 { 00038 public: 00040 CBinaryLabels(); 00041 00046 CBinaryLabels(int32_t num_labels); 00047 00055 CBinaryLabels(SGVector<float64_t> src, float64_t threshold=0.0); 00056 00061 CBinaryLabels(CFile* loader); 00062 00067 static CBinaryLabels* obtain_from_generic(CLabels* base_labels); 00068 00075 virtual void ensure_valid(const char* context=NULL); 00076 00081 virtual ELabelType get_label_type(); 00082 00091 void scores_to_probabilities(); 00092 00094 virtual const char* get_name() const { return "BinaryLabels"; } 00095 }; 00096 } 00097 #endif