Update submodule
This commit is contained in:
parent
1e1e48a4ae
commit
0591fcbb10
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -1,3 +1,3 @@
|
||||
[submodule ".latent-data/qlib"]
|
||||
path = .latent-data/qlib
|
||||
url = git@github.com:microsoft/qlib.git
|
||||
url = git@github.com:D-X-Y/qlib.git
|
||||
|
@ -7,3 +7,8 @@ git submodule init
|
||||
git submodule update
|
||||
git pull orign main
|
||||
```
|
||||
|
||||
Pylint check for Q-lib:
|
||||
```
|
||||
python -m black __init__.py -l 120
|
||||
```
|
||||
|
@ -92,6 +92,9 @@ alias ll='ls -alF'
|
||||
alias la='ls -A'
|
||||
alias l='ls -CF'
|
||||
|
||||
# Change the Color
|
||||
PS1='\[\e[1;35m\][\[\e[1;33m\]\u@\h \[\e[1;31m\]\w\[\e[1;35m\]]\[\e[1;36m\]\$ \[\e[0m\]'
|
||||
|
||||
# Add an "alert" alias for long running commands. Use like so:
|
||||
# sleep 10; alert
|
||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||
|
148
notebooks/Q/workflow-test.ipynb
Normal file
148
notebooks/Q/workflow-test.ipynb
Normal file
@ -0,0 +1,148 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[95290:MainThread](2021-03-03 12:14:32,922) INFO - qlib.Initialization - [config.py:276] - default_conf: client.\n",
|
||||
"[95290:MainThread](2021-03-03 12:14:32,925) WARNING - qlib.Initialization - [config.py:291] - redis connection failed(host=127.0.0.1 port=6379), cache will not be used!\n",
|
||||
"[95290:MainThread](2021-03-03 12:14:33,203) INFO - qlib.Initialization - [__init__.py:46] - qlib successfully initialized based on client settings.\n",
|
||||
"[95290:MainThread](2021-03-03 12:14:33,205) INFO - qlib.Initialization - [__init__.py:47] - data_path=/Users/xuanyidong/.qlib/qlib_data/cn_data\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"import sys\n",
|
||||
"import qlib\n",
|
||||
"import pprint\n",
|
||||
"import numpy as np\n",
|
||||
"import pandas as pd\n",
|
||||
"\n",
|
||||
"from qlib import config as qconfig\n",
|
||||
"from qlib.utils import init_instance_by_config\n",
|
||||
"\n",
|
||||
"qlib.init(provider_uri='~/.qlib/qlib_data/cn_data', region=qconfig.REG_CN)\n",
|
||||
"\n",
|
||||
"dataset_config = {\n",
|
||||
" \"class\": \"DatasetH\",\n",
|
||||
" \"module_path\": \"qlib.data.dataset\",\n",
|
||||
" \"kwargs\": {\n",
|
||||
" \"handler\": {\n",
|
||||
" \"class\": \"Alpha158\",\n",
|
||||
" \"module_path\": \"qlib.contrib.data.handler\",\n",
|
||||
" \"kwargs\": {\n",
|
||||
" \"start_time\": \"2008-01-01\",\n",
|
||||
" \"end_time\": \"2020-08-01\",\n",
|
||||
" \"fit_start_time\": \"2008-01-01\",\n",
|
||||
" \"fit_end_time\": \"2014-12-31\",\n",
|
||||
" \"instruments\": \"csi300\",\n",
|
||||
" },\n",
|
||||
" },\n",
|
||||
" \"segments\": {\n",
|
||||
" \"train\": (\"2008-01-01\", \"2014-12-31\"),\n",
|
||||
" \"valid\": (\"2015-01-01\", \"2016-12-31\"),\n",
|
||||
" \"test\": (\"2017-01-01\", \"2020-08-01\"),\n",
|
||||
" },\n",
|
||||
" },\n",
|
||||
" }"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{'class': 'DatasetH',\n",
|
||||
" 'kwargs': {'handler': {'class': 'Alpha158',\n",
|
||||
" 'kwargs': {'end_time': '2020-08-01',\n",
|
||||
" 'fit_end_time': '2014-12-31',\n",
|
||||
" 'fit_start_time': '2008-01-01',\n",
|
||||
" 'instruments': 'csi300',\n",
|
||||
" 'start_time': '2008-01-01'},\n",
|
||||
" 'module_path': 'qlib.contrib.data.handler'},\n",
|
||||
" 'segments': {'test': ('2017-01-01', '2020-08-01'),\n",
|
||||
" 'train': ('2008-01-01', '2014-12-31'),\n",
|
||||
" 'valid': ('2015-01-01', '2016-12-31')}},\n",
|
||||
" 'module_path': 'qlib.data.dataset'}\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[95290:MainThread](2021-03-03 12:18:43,481) INFO - qlib.timer - [log.py:81] - Time cost: 237.911s | Loading data Done\n",
|
||||
"[95290:MainThread](2021-03-03 12:18:45,080) INFO - qlib.timer - [log.py:81] - Time cost: 0.465s | DropnaLabel Done\n",
|
||||
"[95290:MainThread](2021-03-03 12:18:51,572) INFO - qlib.timer - [log.py:81] - Time cost: 6.491s | CSZScoreNorm Done\n",
|
||||
"[95290:MainThread](2021-03-03 12:18:51,573) INFO - qlib.timer - [log.py:81] - Time cost: 8.090s | fit & process data Done\n",
|
||||
"[95290:MainThread](2021-03-03 12:18:51,573) INFO - qlib.timer - [log.py:81] - Time cost: 246.003s | Init data Done\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"pprint.pprint(dataset_config)\n",
|
||||
"dataset = init_instance_by_config(dataset_config)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{'class': 'MLflowExpManager', 'module_path': 'qlib.workflow.expm', 'kwargs': {'uri': 'file:/Users/xuanyidong/Desktop/AutoDL-Projects/notebooks/Q/mlruns', 'default_exp_name': 'Experiment'}}\n",
|
||||
"Wrapper(provider=<qlib.workflow.QlibRecorder object at 0x7ff46b8a4850>)\n",
|
||||
"<qlib.workflow.expm.MLflowExpManager object at 0x7ff46b8a4c10>\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from qlib.workflow import R\n",
|
||||
"from qlib.config import C\n",
|
||||
"print(C.exp_manager)\n",
|
||||
"print(R)\n",
|
||||
"print(R.exp_manager)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.3"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 4
|
||||
}
|
Loading…
Reference in New Issue
Block a user