1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-04 11:30:57 +08:00

data.rst update

This commit is contained in:
Young
2020-11-26 09:15:13 +00:00
parent 3a3937aa42
commit 7d092f39c8

View File

@@ -143,7 +143,7 @@ Filter
Expression dynamic instrument filter. Filter the instruments based on a certain expression. An expression rule indicating a certain feature field is required.
- `basic features filter`: rule_expression = '$close/$open>5'
- `cross-sectional features filter` : rule_expression = '$rank($close)<10'
- `cross-sectional features filter` \: rule_expression = '$rank($close)<10'
- `time-sequence features filter`: rule_expression = '$Ref($close, 3)>100'
To know more about ``Filter``, please refer to `Filter API <../reference/api.html#module-qlib.data.filter>`_.
@@ -169,11 +169,11 @@ Here are some interfaces of the ``QlibDataLoader`` class:
- `load(instruments, start_time=None, end_time=None)`
- This method loads the data as pd.DataFrame
- Parameters:
- `instruments` : str or dict
- `instruments` \: str or dict
it can either be the market name or the config file of instruments generated by InstrumentProvider.
- `start_time` : str
- `start_time` \: str
start of the time range.
- `end_time` : str
- `end_time` \: str
end of the time range.
- Returns:
- The data being loaded with type `pd.DataFrame`
@@ -181,15 +181,15 @@ Here are some interfaces of the ``QlibDataLoader`` class:
- `load_group_df(instruments, exprs: list, names: list, start_time=None, end_time=None)`
- This method loads the dataframe for specific group.
- Parameters:
- `instruments` : str or dict
- `instruments` \: str or dict
it can either be the market name or the config file of instruments generated by InstrumentProvider.
- `exprs` : list
- `exprs` \: list
the expressions to describe the content of the data.
- `names` : list
- `names` \: list
the name of the data.
- `start_time` : str
- `start_time` \: str
start of the time range.
- `end_time` : str
- `end_time` \: str
end of the time range.
- Returns:
- The queried data in type `pd.DataFrame`.
@@ -220,7 +220,7 @@ Here are some important interfaces that ``DataHandlerLP`` provides:
- `__init__(instruments=None, start_time=None, end_time=None, data_loader: Tuple[dict, str, DataLoader] = None, infer_processors=[], learn_processors=[], process_type=PTYPE_A, **kwargs)`
- Initialization of the class.
- Parameters:
- `infer_processors` : list
- `infer_processors` \: list
- list of <description info> of processors to generate data for inference
- example of <description info>:
@@ -238,7 +238,7 @@ Here are some important interfaces that ``DataHandlerLP`` provides:
"DropnaFeature"
3) object instance of Processor
- `learn_processors` : list
- `learn_processors` \: list
similar to infer_processors, but for generating data for learning models
- `process_type`: str
@@ -253,13 +253,13 @@ Here are some important interfaces that ``DataHandlerLP`` provides:
- `fetch(selector: Union[pd.Timestamp, slice, str] = slice(None, None), level: Union[str, int] = "datetime", col_set=DataHandler.CS_ALL, data_key: str = DK_I)`
- This method fetches data from underlying data source
- Parameters:
- `selector` : Union[pd.Timestamp, slice, str]
- `selector` \: Union[pd.Timestamp, slice, str]
describe how to select data by index.
- `level` : Union[str, int]
- `level` \: Union[str, int]
which index level to select the data.
- `col_set` : str
- `col_set` \: str
select a set of meaningful columns.(e.g. features, columns).
- `data_key` : str
- `data_key` \: str
The data to fetch: DK_*.
- Returns:
- The retrieved results in the type: `pd.DataFrame`.
@@ -267,9 +267,9 @@ Here are some important interfaces that ``DataHandlerLP`` provides:
- `get_cols(col_set=DataHandler.CS_ALL, data_key: str = DK_I)`
- This method gets the column names.
- Parameters:
- `col_set` : str
- `col_set` \: str
select a set of meaningful columns.(e.g. features, columns).
- `data_key` : str
- `data_key` \: str
the data to fetch: DK_*.
- Returns:
- A list of column names.
@@ -356,7 +356,7 @@ The ``DatasetH`` class is the `dataset` with `Data Handler`. Here is the most im
- `prepare(segments: Union[List[str], Tuple[str], str, slice], col_set=DataHandler.CS_ALL, data_key=DataHandlerLP.DK_I, **kwargs)`
- This method prepares the data for learning and inference.
- Parameters:
- `segments` : Union[List[str], Tuple[str], str, slice]
- `segments` \: Union[List[str], Tuple[str], str, slice]
Describe the scope of the data to be prepared
Here are some examples:
@@ -364,9 +364,9 @@ The ``DatasetH`` class is the `dataset` with `Data Handler`. Here is the most im
- ['train', 'valid']
- `col_set` : str
- `col_set` \: str
The col_set will be passed to self._handler when fetching data.
- `data_key` : str
- `data_key` \: str
The data to fetch: DK_*
Default is DK_I, which indicate fetching data for **inference**.