Skip to content

Commit 4dc10d2

Browse files
authored
Merge pull request #359 from bxdd/doc0
Fix data doc
2 parents 2b74b4d + 4b56a4e commit 4dc10d2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/component/data.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,10 @@ Here are some important interfaces that ``DataHandlerLP`` provides:
298298
.. autoclass:: qlib.data.dataset.handler.DataHandlerLP
299299
:members: __init__, fetch, get_cols
300300

301-
If users want to load features and labels by config, users can inherit ``qlib.data.dataset.handler.ConfigDataHandler``, ``Qlib`` also provides some preprocess method in this subclass.
302301

303-
If users want to use qlib data, `QLibDataHandler` is recommended. Users can inherit their custom class from `QLibDataHandler`, which is also a subclass of `ConfigDataHandler`.
302+
If users want to load features and labels by config, users can define a new handler and call the static method `parse_config_to_fields` of ``qlib.contrib.data.handler.Alpha158``.
303+
304+
Also, users can pass ``qlib.contrib.data.processor.ConfigSectionProcessor`` that provides some preprocess methods for features defined by config into the new handler.
304305

305306

306307
Processor
@@ -337,7 +338,6 @@ Qlib provides implemented data handler `Alpha158`. The following example shows h
337338

338339
.. note:: Users need to initialize ``Qlib`` with `qlib.init` first, please refer to `initialization <../start/initialization.html>`_.
339340

340-
341341
.. code-block:: Python
342342
343343
import qlib
@@ -364,6 +364,9 @@ Qlib provides implemented data handler `Alpha158`. The following example shows h
364364
# fetch all the features
365365
print(h.fetch(col_set="feature"))
366366
367+
368+
.. note:: In the ``Alpha158``, ``Qlib`` uses the label `Ref($close, -2)/Ref($close, -1) - 1` that means the change from T+1 to T+2, rather than `Ref($close, -1)/$close - 1`, of which the reason is that when getting the T day close price of a china stock, the stock can be bought on T+1 day and sold on T+2 day.
369+
367370
API
368371
---------
369372

0 commit comments

Comments
 (0)