00001 /* 00002 * Copyright (c) 2009 Yahoo! Inc. All rights reserved. The copyrights 00003 * embodied in the content of this file are licensed under the BSD 00004 * (revised) open source license. 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 3 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * Written (W) 2011 Shashwat Lal Das 00012 * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society. 00013 */ 00014 00015 #ifndef _VW_LABEL_H__ 00016 #define _VW_LABEL_H__ 00017 00018 #include <shogun/lib/DataType.h> 00019 #include <shogun/lib/common.h> 00020 #include <shogun/lib/v_array.h> 00021 #include <shogun/io/SGIO.h> 00022 #include <shogun/mathematics/Math.h> 00023 00024 namespace shogun 00025 { 00026 00032 class VwLabel 00033 { 00034 public: 00038 VwLabel(): label(FLT_MAX), weight(1.), initial(0.) { } 00039 00043 ~VwLabel() { } 00044 00049 inline float32_t get_label() { return label; } 00050 00055 inline void set_label(float32_t l) { label = l; } 00056 00061 inline float32_t get_weight() { return weight; } 00062 00067 inline void set_weight(float32_t w) { weight = w; } 00068 00073 inline float32_t get_initial() { return initial; } 00074 00079 inline void set_initial(float32_t i) { initial = i; } 00080 00086 void label_from_substring(v_array<substring>& words); 00087 00088 public: 00090 float32_t label; 00092 float32_t weight; 00094 float32_t initial; 00095 }; 00096 00097 } 00098 #endif // _VW_LABEL_H__