SHOGUN
v1.1.0
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
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::v_array
Class v_array is a templated class used to store variable length arrays. Memory locations are stored ...
Definition:
v_array.h:39
shogun::v_array::index
unsigned int index()
Definition:
v_array.h:96
shogun::float_of_substring
float32_t float_of_substring(substring s)
Definition:
SGIO.h:488
vw_label.h
shogun::VwLabel::label
float32_t label
Label value.
Definition:
vw_label.h:90
shogun::VwLabel::weight
float32_t weight
Weight of example.
Definition:
vw_label.h:92
shogun::VwLabel::parse_label
void parse_label(v_array< substring > &words)
Definition:
vw_label.cpp:19
shogun::VwLabel::initial
float32_t initial
Initial approximation.
Definition:
vw_label.h:94
SG_SERROR
#define SG_SERROR(...)
Definition:
SGIO.h:94
SHOGUN
Machine Learning Toolbox - Documentation