mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-06 20:41:09 +08:00
nested data loader
This commit is contained in:
35
tests/data_mid_layer_tests/test_dataloader.py
Normal file
35
tests/data_mid_layer_tests/test_dataloader.py
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
# TODO:
|
||||
# dump alpha 360 to dataframe and merge it with Alpha158
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
from qlib.data.dataset.loader import NestedDataLoader
|
||||
|
||||
|
||||
class TestDataLoader(unittest.TestCase):
|
||||
|
||||
|
||||
def test_nested_data_loader(self):
|
||||
nd = NestedDataLoader(
|
||||
dataloader_l=[
|
||||
{
|
||||
"class": "qlib.contrib.data.loader.Alpha158DL",
|
||||
}, {
|
||||
"class": "qlib.contrib.data.loader.Alpha360DL",
|
||||
"kwargs": {
|
||||
"config": {
|
||||
"label": ( ["Ref($close, -2)/Ref($close, -1) - 1"], ["LABEL0"])
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
)
|
||||
|
||||
nd.load
|
||||
...
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user