SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vw_label.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 Yahoo! Inc. All rights reserved. The copyrights
3  * embodied in the content of this file are licensed under the BSD
4  * (revised) open source license.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Written (W) 2011 Shashwat Lal Das
12  * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society.
13  */
14 
16 
17 using namespace shogun;
18 
20 {
21  switch(words.index())
22  {
23  case 0:
24  break;
25  case 1:
26  label = SGIO::float_of_substring(words[0]);
27  break;
28  case 2:
29  label = SGIO::float_of_substring(words[0]);
30  weight = SGIO::float_of_substring(words[1]);
31  break;
32  case 3:
33  label = SGIO::float_of_substring(words[0]);
34  weight = SGIO::float_of_substring(words[1]);
36  break;
37  default:
38  SG_SERROR("malformed example!\n"
39  "words.index() = %d\n", words.index());
40  }
41 }

SHOGUN Machine Learning Toolbox - Documentation