MCPcopy
hub / github.com/microsoft/qlib / setup_data

Method setup_data

qlib/data/dataset/handler.py:174–196  ·  view source on GitHub ↗

Set Up the data in case of running initialization for multiple time It is responsible for maintaining following variable 1) self._data Parameters ---------- enable_cache : bool default value is false: - if `enable_cache` ==

(self, enable_cache: bool = False)

Source from the content-addressed store, hash-verified

172 super().config(**kwargs)
173
174 def setup_data(self, enable_cache: bool = False):
175 """
176 Set Up the data in case of running initialization for multiple time
177
178 It is responsible for maintaining following variable
179 1) self._data
180
181 Parameters
182 ----------
183 enable_cache : bool
184 default value is false:
185
186 - if `enable_cache` == True:
187
188 the processed data will be saved on disk, and handler will load the cached data from the disk directly
189 when we call `init` next time
190 """
191 # Setup data.
192 # _data may be with multiple column index level. The outer level indicates the feature set name
193 with TimeInspector.logt("Loading data"):
194 # make sure the fetch method is based on an index-sorted pd.DataFrame
195 self._data = lazy_sort_index(self.data_loader.load(self.instruments, self.start_time, self.end_time))
196 # TODO: cache
197
198 def fetch(
199 self,

Callers 2

__init__Method · 0.95
setup_dataMethod · 0.45

Calls 3

lazy_sort_indexFunction · 0.85
logtMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected