mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-14 00:06:58 +08:00
Merge branch 'main' of github.com:microsoft/qlib into fshare
This commit is contained in:
@@ -70,3 +70,31 @@ If the issue is not resolved, use ``keys *`` to find if multiple keys exist. If
|
|||||||
|
|
||||||
|
|
||||||
Also, feel free to post a new issue in our GitHub repository. We always check each issue carefully and try our best to solve them.
|
Also, feel free to post a new issue in our GitHub repository. We always check each issue carefully and try our best to solve them.
|
||||||
|
|
||||||
|
3. ModuleNotFoundError: No module named 'qlib.data._libs.rolling'
|
||||||
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
#### Do not import qlib package in the repository directory in case of importing qlib from . without compiling #####
|
||||||
|
Traceback (most recent call last):
|
||||||
|
File "<stdin>", line 1, in <module>
|
||||||
|
File "qlib/qlib/__init__.py", line 19, in init
|
||||||
|
from .data.cache import H
|
||||||
|
File "qlib/qlib/data/__init__.py", line 8, in <module>
|
||||||
|
from .data import (
|
||||||
|
File "qlib/qlib/data/data.py", line 20, in <module>
|
||||||
|
from .cache import H
|
||||||
|
File "qlib/qlib/data/cache.py", line 36, in <module>
|
||||||
|
from .ops import Operators
|
||||||
|
File "qlib/qlib/data/ops.py", line 19, in <module>
|
||||||
|
from ._libs.rolling import rolling_slope, rolling_rsquare, rolling_resi
|
||||||
|
ModuleNotFoundError: No module named 'qlib.data._libs.rolling'
|
||||||
|
|
||||||
|
- If the error occurs when importing ``qlib`` package with ``PyCharm`` IDE, users can execute the following command in the project root folder to compile Cython files and generate executable files:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
python setup.py build_ext --inplace
|
||||||
|
|
||||||
|
- If the error occurs when importing ``qlib`` package with command ``python`` , users need to change the running directory to ensure that the script does not run in the project directory.
|
||||||
@@ -1182,7 +1182,7 @@ class Slope(Rolling):
|
|||||||
Returns
|
Returns
|
||||||
----------
|
----------
|
||||||
Expression
|
Expression
|
||||||
a feature instance with regression slope of given window
|
a feature instance with linear regression slope of given window
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, feature, N):
|
def __init__(self, feature, N):
|
||||||
@@ -1210,7 +1210,7 @@ class Rsquare(Rolling):
|
|||||||
Returns
|
Returns
|
||||||
----------
|
----------
|
||||||
Expression
|
Expression
|
||||||
a feature instance with regression r-value square of given window
|
a feature instance with linear regression r-value square of given window
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, feature, N):
|
def __init__(self, feature, N):
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ pip install -r requirements.txt
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# parse instruments, using in qlib/instruments.
|
# parse instruments, using in qlib/instruments.
|
||||||
python collector.py --index_name SP500 --qlib_dir ~/.qlib/qlib_data/cn_data --method parse_instruments
|
python collector.py --index_name SP500 --qlib_dir ~/.qlib/qlib_data/us_data --method parse_instruments
|
||||||
|
|
||||||
# parse new companies
|
# parse new companies
|
||||||
python collector.py --index_name SP500 --qlib_dir ~/.qlib/qlib_data/cn_data --method save_new_companies
|
python collector.py --index_name SP500 --qlib_dir ~/.qlib/qlib_data/us_data --method save_new_companies
|
||||||
|
|
||||||
# index_name support: SP500, NASDAQ100, DJIA, SP400
|
# index_name support: SP500, NASDAQ100, DJIA, SP400
|
||||||
# help
|
# help
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/qlib_cn_1d -
|
|||||||
import qlib
|
import qlib
|
||||||
from qlib.data import D
|
from qlib.data import D
|
||||||
|
|
||||||
qlib.init(provider_uri="~/.qlib/qlib_data/qlib_cn_1d", region="CN")
|
qlib.init(provider_uri="~/.qlib/qlib_data/qlib_cn_1d", region="cn")
|
||||||
df = D.features(D.instruments("all"), ["$close"], freq="day")
|
df = D.features(D.instruments("all"), ["$close"], freq="day")
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/qlib_cn_1min
|
|||||||
import qlib
|
import qlib
|
||||||
from qlib.data import D
|
from qlib.data import D
|
||||||
|
|
||||||
qlib.init(provider_uri="~/.qlib/qlib_data/qlib_cn_1min", region="CN")
|
qlib.init(provider_uri="~/.qlib/qlib_data/qlib_cn_1min", region="cn")
|
||||||
df = D.features(D.instruments("all"), ["$close"], freq="1min")
|
df = D.features(D.instruments("all"), ["$close"], freq="1min")
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -97,7 +97,7 @@ python collector.py normalize_data --source_dir ~/.qlib/stock_data/source/us_1d
|
|||||||
|
|
||||||
# dump data
|
# dump data
|
||||||
cd qlib/scripts
|
cd qlib/scripts
|
||||||
python dump_bin.py dump_all --csv_path ~/.qlib/stock_data/source/cn_1d_nor --qlib_dir ~/.qlib/stock_data/source/qlib_us_1d --freq day --exclude_fields date,adjclose,dividends,splits,symbol
|
python dump_bin.py dump_all --csv_path ~/.qlib/stock_data/source/us_1d_nor --qlib_dir ~/.qlib/stock_data/source/qlib_us_1d --freq day --exclude_fields date,adjclose,dividends,splits,symbol
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 1d from qlib
|
#### 1d from qlib
|
||||||
@@ -113,7 +113,7 @@ python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/qlib_us_1d -
|
|||||||
import qlib
|
import qlib
|
||||||
from qlib.data import D
|
from qlib.data import D
|
||||||
|
|
||||||
qlib.init(provider_uri="~/.qlib/qlib_data/qlib_us_1d", region="US")
|
qlib.init(provider_uri="~/.qlib/qlib_data/qlib_us_1d", region="us")
|
||||||
df = D.features(D.instruments("all"), ["$close"], freq="day")
|
df = D.features(D.instruments("all"), ["$close"], freq="day")
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user