SHOGUN
v2.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
classifier
vw
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
15
#include <
shogun/classifier/vw/vw_label.h
>
16
17
using namespace
shogun;
18
19
void
VwLabel::parse_label
(
v_array<substring>
& words)
20
{
21
switch
(words.
index
())
22
{
23
case
0:
24
break
;
25
case
1:
26
label
=
float_of_substring
(words[0]);
27
break
;
28
case
2:
29
label
=
float_of_substring
(words[0]);
30
weight
=
float_of_substring
(words[1]);
31
break
;
32
case
3:
33
label
=
float_of_substring
(words[0]);
34
weight
=
float_of_substring
(words[1]);
35
initial
=
float_of_substring
(words[2]);
36
break
;
37
default
:
38
SG_SERROR
(
"malformed example!\n"
39
"words.index() = %d\n"
, words.
index
());
40
}
41
}
SHOGUN
Machine Learning Toolbox - Documentation