SHOGUN  6.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
StreamingFeatures.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2011 Shashwat Lal Das
8  * Written (W) 2012 Heiko Strathmann
9  * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
10  */
11 #ifndef _STREAMING_FEATURES__H__
12 #define _STREAMING_FEATURES__H__
13 
14 #include <shogun/lib/config.h>
15 
16 #include <shogun/lib/common.h>
19 
20 namespace shogun
21 {
73 {
74 
75 public:
76 
82 
83  CStreamingFeatures(const CStreamingFeatures&) = delete;
84 
88  virtual ~CStreamingFeatures();
89 
96  void set_read_functions();
97 
106  virtual void set_vector_reader()=0;
107 
117  virtual void set_vector_and_label_reader()=0;
118 
123  virtual void start_parser()=0;
124 
128  virtual void end_parser()=0;
129 
137  virtual float64_t get_label()=0;
138 
144  virtual bool get_next_example()=0;
145 
151  virtual void release_example()=0;
152 
158  virtual int32_t get_num_features()=0;
159 
165  virtual bool get_has_labels();
166 
177  virtual bool is_seekable();
178 
182  virtual void reset_stream();
183 
193  virtual CFeatures* get_streamed_features(index_t num_elements)
194  {
195  SG_ERROR("%s::get_streamed_features() is not yet implemented!\n",
196  get_name());
197  return NULL;
198  }
199 
205  virtual CFeatures* duplicate() const
206  {
208  return NULL;
209  }
210 
211 protected:
212 
215 
218 
220  bool seekable;
221 
222 };
223 }
224 #endif // _STREAMING_FEATURES__H__
virtual const char * get_name() const =0
virtual void start_parser()=0
int32_t index_t
Definition: common.h:72
virtual CFeatures * get_streamed_features(index_t num_elements)
bool has_labels
Whether examples are labelled or not.
#define SG_ERROR(...)
Definition: SGIO.h:128
#define SG_NOTIMPLEMENTED
Definition: SGIO.h:138
CStreamingFile * working_file
The StreamingFile object to read from.
A Streaming File access class.
Definition: StreamingFile.h:34
virtual CFeatures * duplicate() const
virtual bool get_next_example()=0
virtual void set_vector_and_label_reader()=0
double float64_t
Definition: common.h:60
virtual void set_vector_reader()=0
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual void end_parser()=0
bool seekable
Whether the stream is seekable.
The class Features is the base class of all feature objects.
Definition: Features.h:68
virtual void release_example()=0
Streaming features are features which are used for online algorithms.
virtual float64_t get_label()=0
virtual int32_t get_num_features()=0

SHOGUN Machine Learning Toolbox - Documentation