SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
StreamingVwCacheFile.h
浏览该文件的文档.
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  * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
9  */
10 #ifndef __STREAMING_VWCACHEFILE_H__
11 #define __STREAMING_VWCACHEFILE_H__
12 
13 #include <shogun/lib/config.h>
14 
19 
20 namespace shogun
21 {
33 {
34 public:
40 
48 
56  CStreamingVwCacheFile(char* fname, char rw='r', EVwCacheType cache_type = C_NATIVE);
57 
61  virtual ~CStreamingVwCacheFile();
62 
73  virtual void get_vector(VwExample* &ex, int32_t &len);
74 
84  virtual void get_vector_and_label(VwExample* &ex, int32_t &len, float64_t &label);
85 
87  virtual const char* get_name() const
88  {
89  return "StreamingVwCacheFile";
90  }
91 
97  void set_env(CVwEnvironment* env_to_use);
98 
105  {
106  SG_REF(env);
107  return env;
108  }
109 
115  bool is_seekable() { return true; }
116 
122  void reset_stream();
123 
124 private:
130  virtual void init(EVwCacheType cache_type);
131 
132 protected:
135 
138 
141 };
142 }
143 #endif //__STREAMING_VWCACHEFILE_H__
EVwCacheType cache_format
Cache type.
CVwCacheReader * cache_reader
Cache reader.
Base class from which all cache readers for VW should be derived.
Definition: VwCacheReader.h:43
Class CVwEnvironment is the environment used by VW.
Definition: VwEnvironment.h:41
#define SG_REF(x)
Definition: SGObject.h:51
A Streaming File access class.
Definition: StreamingFile.h:34
virtual void get_vector(VwExample *&ex, int32_t &len)
double float64_t
Definition: common.h:50
Example class for VW.
Definition: vw_example.h:58
Class StreamingVwCacheFile to read vector-by-vector from VW cache files.
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
void set_env(CVwEnvironment *env_to_use)
virtual const char * get_name() const
virtual void get_vector_and_label(VwExample *&ex, int32_t &len, float64_t &label)
CVwEnvironment * env
Environment used for vw.

SHOGUN 机器学习工具包 - 项目文档