diff --git a/docs/component/backtest.rst b/docs/component/backtest.rst index d36dba316..88e01e2de 100644 --- a/docs/component/backtest.rst +++ b/docs/component/backtest.rst @@ -13,7 +13,7 @@ Introduction .. note:: - ``Intraday Trading`` uses ``Order Executor`` to trade and execute orders output by ``Interday Strategy``. ``Order Executor`` is a component in `Qlib Framework <../introduction/introduction.html#framework>`_, which can execute orders. ``Vwap Executor`` and ``Close Executor`` is supported by ``Qlib`` now. In the future, ``Qlib`` will support ``HighFreq Executor`` also. + ``Intraday Trading`` uses ``Order Executor`` to trade and execute orders output by ``Portfolio Strategy``. ``Order Executor`` is a component in `Qlib Framework <../introduction/introduction.html#framework>`_, which can execute orders. ``VWAP Executor`` and ``Close Executor`` is supported by ``Qlib`` now. In the future, ``Qlib`` will support ``HighFreq Executor`` also. @@ -32,34 +32,34 @@ The simple example of the default strategy is as follows. # pred_score is the prediction score report, positions = backtest(pred_score, topk=50, n_drop=0.5, verbose=False, limit_threshold=0.0095) -To know more about backtesting with a specific ``Strategy``, please refer to `Strategy `_. +To know more about backtesting with a specific ``Strategy``, please refer to `Portfolio Strategy `_. -To know more about the prediction score `pred_score` output by ``Interday Model``, please refer to `Interday Model: Model Training & Prediction `_. +To know more about the prediction score `pred_score` output by ``Forecast Model``, please refer to `Forecast Model: Model Training & Prediction `_. Prediction Score ----------------- -The `prediction score` is a pandas DataFrame. Its index is and it must +The `prediction score` is a pandas DataFrame. Its index is and it must contains a `score` column. A prediction sample is shown as follows. .. code-block:: python - instrument datetime score - SH600000 2019-01-04 -0.505488 - SZ002531 2019-01-04 -0.320391 - SZ000999 2019-01-04 0.583808 - SZ300569 2019-01-04 0.819628 - SZ001696 2019-01-04 -0.137140 - ... ... - SZ000996 2019-04-30 -1.027618 - SH603127 2019-04-30 0.225677 - SH603126 2019-04-30 0.462443 - SH603133 2019-04-30 -0.302460 - SZ300760 2019-04-30 -0.126383 + datetime instrument score + 2019-01-04 SH600000 -0.505488 + 2019-01-04 SZ002531 -0.320391 + 2019-01-04 SZ000999 0.583808 + 2019-01-04 SZ300569 0.819628 + 2019-01-04 SZ001696 -0.137140 + ... ... + 2019-04-30 SZ000996 -1.027618 + 2019-04-30 SH603127 0.225677 + 2019-04-30 SH603126 0.462443 + 2019-04-30 SH603133 -0.302460 + 2019-04-30 SZ300760 -0.126383 -``Interday Model`` module can make predictions, please refer to `Interday Model: Model Training & Prediction `_. +``Forecast Model`` module can make predictions, please refer to `Forecast Model: Model Training & Prediction `_. Backtest Result ------------------ diff --git a/docs/component/data.rst b/docs/component/data.rst index 55d6c7207..ed95c9bf7 100644 --- a/docs/component/data.rst +++ b/docs/component/data.rst @@ -206,7 +206,7 @@ Data Loader QlibDataLoader --------------- -The ``QlibDataLoader`` class in ``Qlib`` is such an interface that allows users to load raw data from the data source. +The ``QlibDataLoader`` class in ``Qlib`` is such an interface that allows users to load raw data from the ``Qlib`` data source. Interface ------------ @@ -234,7 +234,7 @@ DataHandlerLP In addition to use ``Data Handler`` in an automatic workflow with ``qrun``, ``Data Handler`` can be used as an independent module, by which users can easily preprocess data (standardization, remove NaN, etc.) and build datasets. -In order to achieve so, ``Qlib`` provides a base class `qlib.data.dataset.DataHandlerLP <../reference/api.html#qlib.data.dataset.handler.DataHandlerLP>`_. The core idea of this class is that: we will have some leanable ``Processors`` which can learn the parameters of data processing. When new data comes in, these `trained` ``Processors`` can then infer on the new data and thus processing real-time data in an efficient way. More information about ``Processors`` will be listed in the next subsection. +In order to achieve so, ``Qlib`` provides a base class `qlib.data.dataset.DataHandlerLP <../reference/api.html#qlib.data.dataset.handler.DataHandlerLP>`_. The core idea of this class is that: we will have some leanable ``Processors`` which can learn the parameters of data processing(e.g., parameters for zscore normalization). When new data comes in, these `trained` ``Processors`` can then process the new data and thus processing real-time data in an efficient way becomes possible. More information about ``Processors`` will be listed in the next subsection. Interface @@ -321,7 +321,10 @@ Dataset The ``Dataset`` module in ``Qlib`` aims to prepare data for model training and inferencing. -The motivation of this module is that we want to maximize the flexibility of of different models to handle data that are suitable for themselves. This module gives the model the rights to process their data in an unique way. For instance, models such as ``GBDT`` may work well on data that contains `nan` or `None` value, while neural networks such as ``MLP`` will break down on such data. +The motivation of this module is that we want to maximize the flexibility of of different models to handle data that are suitable for themselves. This module gives the model the flexibility to process their data in an unique way. For instance, models such as ``GBDT`` may work well on data that contains `nan` or `None` value, while neural networks such as ``MLP`` will break down on such data. + +If user's model need process its data in a different way, user could implement his own ``Dataset`` class. If the model's +data processing is not special, ``DatasetH`` can be used directly. The ``DatasetH`` class is the `dataset` with `Data Handler`. Here is the most important interface of the class: diff --git a/docs/component/model.rst b/docs/component/model.rst index e4aa4ca91..96fb93945 100644 --- a/docs/component/model.rst +++ b/docs/component/model.rst @@ -1,15 +1,15 @@ .. _model: ============================================ -Interday Model: Model Training & Prediction +Forecast Model: Model Training & Prediction ============================================ Introduction =================== -``Interday Model`` is designed to make the `prediction score` about stocks. Users can use the ``Interday Model`` in an automatic workflow by ``qrun``, please refer to `Workflow: Workflow Management `_. +``Forecast Model`` is designed to make the `prediction score` about stocks. Users can use the ``Forecast Model`` in an automatic workflow by ``qrun``, please refer to `Workflow: Workflow Management `_. -Because the components in ``Qlib`` are designed in a loosely-coupled way, ``Interday Model`` can be used as an independent module also. +Because the components in ``Qlib`` are designed in a loosely-coupled way, ``Forecast Model`` can be used as an independent module also. Base Class & Interface ====================== @@ -63,7 +63,7 @@ For other interfaces such as `finetune`, please refer to `Model API <../referenc Example ================== -``Qlib``'s `Model Zoo` includes models such as ``LightGBM``, ``MLP``, ``LSTM``, etc.. These models are treated as the baselines of ``Interday Model``. The following steps show how to run`` LightGBM`` as an independent module. +``Qlib``'s `Model Zoo` includes models such as ``LightGBM``, ``MLP``, ``LSTM``, etc.. These models are treated as the baselines of ``Forecast Model``. The following steps show how to run`` LightGBM`` as an independent module. - Initialize ``Qlib`` with `qlib.init` first, please refer to `Initialization <../start/initialization.html>`_. - Run the following code to get the `prediction score` `pred_score` diff --git a/docs/component/recorder.rst b/docs/component/recorder.rst index 4304dcce5..a7516587c 100644 --- a/docs/component/recorder.rst +++ b/docs/component/recorder.rst @@ -7,7 +7,7 @@ Qlib Recorder: Experiment Management Introduction =================== -``Qlib`` contains an experiment management system named ``QlibRecorder``, which is designed to help users handle experiment and analysis results in an efficient way. +``Qlib`` contains an experiment management system named ``QlibRecorder``, which is designed to help users handle experiment and analyse results in an efficient way. There are three components of the system: @@ -34,8 +34,7 @@ Here is a general view of the structure of the system: - Recorder 2 - ... - ... - -Currently, the components of this experiment management system are implemented using the machine learning platform: ``MLFlow`` (`link `_). +This experiment management system defines a set of interface and provided a concrete implementation based on the machine learning platform: ``MLFlow`` (`link `_). Qlib Recorder @@ -94,4 +93,4 @@ The ``RecordTemp`` class is a class that enables generate experiment results suc - ``SigAnaRecord``: This class generates the `IC`, `ICIR`, `Rank IC` and `Rank ICIR` of the model. - ``PortAnaRecord``: This class generates the results of `backtest`. The detailed information about `backtest` as well as the available `strategy`, users can refer to `Strategy <../component/strategy.html>`_ and `Backtest <../component/backtest.html>`_. -For more information about the APIs, please refer to `Record Template API <../reference/api.html#module-qlib.workflow.record_temp>`_. \ No newline at end of file +For more information about the APIs, please refer to `Record Template API <../reference/api.html#module-qlib.workflow.record_temp>`_. diff --git a/docs/component/strategy.rst b/docs/component/strategy.rst index 0bdf453fe..0720dcdad 100644 --- a/docs/component/strategy.rst +++ b/docs/component/strategy.rst @@ -1,18 +1,18 @@ .. _strategy: ======================================== -Interday Strategy: Portfolio Management +Portfolio Strategy: Portfolio Management ======================================== .. currentmodule:: qlib Introduction =================== -``Interday Strategy`` is designed to adopt different trading strategies, which means that users can adopt different algorithms to generate investment portfolios based on the prediction scores of the ``Interday Model``. Users can use the ``Interday Strategy`` in an automatic workflow by ``Estimator``, please refer to `Estimator: Workflow Management `_. +``Portfolio Strategy`` is designed to adopt different portfolio strategies, which means that users can adopt different algorithms to generate investment portfolios based on the prediction scores of the ``Forecast Model``. Users can use the ``Portfolio Strategy`` in an automatic workflow by ``Workflow`` module, please refer to `Workflow: Workflow Management `_. -Because the components in ``Qlib`` are designed in a loosely-coupled way, ``Interday Strategy`` can be used as an independent module also. +Because the components in ``Qlib`` are designed in a loosely-coupled way, ``Portfolio Strategy`` can be used as an independent module also. -``Qlib`` provides several implemented trading strategies. Also, ``Qlib`` supports custom strategy, users can customize strategies according to their own needs. +``Qlib`` provides several implemented portfolio strategies. Also, ``Qlib`` supports custom strategy, users can customize strategies according to their own needs. Base Class & Interface ====================== @@ -26,19 +26,20 @@ Qlib provides a base class ``qlib.contrib.strategy.BaseStrategy``. All strategy Return the proportion of your total value you will use in investment. Dynamically risk_degree will result in Market timing. - `generate_order_list` - Rerturn the order list. + Return the order list. Users can inherit `BaseStrategy` to customize their strategy class. WeightStrategyBase -------------------- -Qlib alse provides a class ``qlib.contrib.strategy.WeightStrategyBase`` that is a subclass of `BaseStrategy`. +Qlib also provides a class ``qlib.contrib.strategy.WeightStrategyBase`` that is a subclass of `BaseStrategy`. `WeightStrategyBase` only focuses on the target positions, and automatically generates an order list based on positions. It provides the `generate_target_weight_position` interface. - `generate_target_weight_position` - - According to the current position and trading date to generate the target position. The cash is not considered. + - According to the current position and trading date to generate the target position. The cash is not considered in + the output weight distribution. - Return the target position. .. note:: @@ -81,7 +82,7 @@ TopkDropoutStrategy Usage & Example ==================== -``Interday Strategy`` can be specified in the ``Intraday Trading(Backtest)``, the example is as follows. +``Portfolio Strategy`` can be specified in the ``Intraday Trading(Backtest)``, the example is as follows. .. code-block:: python @@ -110,12 +111,12 @@ Usage & Example pred_score, strategy=strategy, **BACKTEST_CONFIG ) -Also, the above example has been given in ``examples\train_backtest_analyze.ipynb``. +Also, the above example has been given in ``examples/train_backtest_analyze.ipynb``. -To know more about the `prediction score` `pred_score` output by ``Interday Model``, please refer to `Interday Model: Model Training & Prediction `_. +To know more about the `prediction score` `pred_score` output by ``Forecast Model``, please refer to `Forecast Model: Model Training & Prediction `_. To know more about ``Intraday Trading``, please refer to `Intraday Trading: Model&Strategy Testing `_. Reference =================== -To know more about ``Interday Strategy``, please refer to `Strategy API <../reference/api.html#module-qlib.contrib.strategy.strategy>`_. +To know more about ``Portfolio Strategy``, please refer to `Strategy API <../reference/api.html#module-qlib.contrib.strategy.strategy>`_. diff --git a/docs/index.rst b/docs/index.rst index 1e43cf99e..15a36b489 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -37,8 +37,8 @@ Document Structure Workflow: Workflow Management Data Layer: Data Framework&Usage - Interday Model: Model Training & Prediction - Interday Strategy: Portfolio Management + Forecast Model: Model Training & Prediction + Strategy: Portfolio Management Intraday Trading: Model&Strategy Testing Qlib Recorder: Experiment Management Analysis: Evaluation & Results Analysis diff --git a/docs/introduction/quick.rst b/docs/introduction/quick.rst index f228ce2af..1abe3fe76 100644 --- a/docs/introduction/quick.rst +++ b/docs/introduction/quick.rst @@ -91,4 +91,4 @@ Auto Quant Research Workflow Custom Model Integration =============================================== -``Qlib`` provides a batch of models (such as ``lightGBM`` and ``MLP`` models) as examples of ``Interday Model``. In addition to the default model, users can integrate their own custom models into ``Qlib``. If users are interested in the custom model, please refer to `Custom Model Integration <../start/integration.html>`_. +``Qlib`` provides a batch of models (such as ``lightGBM`` and ``MLP`` models) as examples of ``Forecast Model``. In addition to the default model, users can integrate their own custom models into ``Qlib``. If users are interested in the custom model, please refer to `Custom Model Integration <../start/integration.html>`_. diff --git a/docs/start/integration.rst b/docs/start/integration.rst index e36805c01..2f3adb15f 100644 --- a/docs/start/integration.rst +++ b/docs/start/integration.rst @@ -5,7 +5,7 @@ Custom Model Integration Introduction =================== -``Qlib``'s `Model Zoo` includes models such as ``LightGBM``, ``MLP``, ``LSTM``, etc.. These models are examples of ``Interday Model``. In addition to the default models ``Qlib`` provide, users can integrate their own custom models into ``Qlib``. +``Qlib``'s `Model Zoo` includes models such as ``LightGBM``, ``MLP``, ``LSTM``, etc.. These models are examples of ``Forecast Model``. In addition to the default models ``Qlib`` provide, users can integrate their own custom models into ``Qlib``. Users can integrate their own custom models according to the following steps. @@ -141,4 +141,4 @@ Also, ``Model`` can also be tested as a single module. An example has been given Reference ===================== -To know more about ``Interday Model``, please refer to `Interday Model: Model Training & Prediction <../component/model.html>`_ and `Model API <../reference/api.html#module-qlib.model.base>`_. +To know more about ``Forecast Model``, please refer to `Forecast Model: Model Training & Prediction <../component/model.html>`_ and `Model API <../reference/api.html#module-qlib.model.base>`_.