mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-02 02:21:18 +08:00
black format
This commit is contained in:
@@ -57,7 +57,7 @@ class HighFreqNorm(Processor):
|
||||
part_values[slice3] = -3.5
|
||||
# print("start_call_feature_reshape")
|
||||
idx = df_features.index.droplevel("datetime").drop_duplicates()
|
||||
idx.set_names(['instrument', 'datetime'], inplace=True)
|
||||
idx.set_names(["instrument", "datetime"], inplace=True)
|
||||
feat = df_values[:, [0, 1, 2, 3, 4, 10]].reshape(-1, 6 * 240)
|
||||
feat_1 = df_values[:, [5, 6, 7, 8, 9, 11]].reshape(-1, 6 * 240)
|
||||
df_new_features = pd.DataFrame(
|
||||
|
||||
@@ -147,14 +147,13 @@ if __name__ == "__main__":
|
||||
}
|
||||
##=============load the calendar for cache=============
|
||||
Cal.calendar(freq="1min")
|
||||
Cal.get_calendar_day(freq="1min")
|
||||
|
||||
Cal.get_calendar_day(freq="1min")
|
||||
|
||||
##=============get data=============
|
||||
dataset = init_instance_by_config(task["dataset"])
|
||||
dataset_backtest = init_instance_by_config(task["dataset_backtest"])
|
||||
xtrain, xtest = dataset.prepare(['train', 'test'])
|
||||
backtest_train, backtest_test = dataset_backtest.prepare(['train', 'test'])
|
||||
xtrain, xtest = dataset.prepare(["train", "test"])
|
||||
backtest_train, backtest_test = dataset_backtest.prepare(["train", "test"])
|
||||
print(xtrain, xtest)
|
||||
print(backtest_train, backtest_test)
|
||||
del xtrain, xtest
|
||||
@@ -172,15 +171,13 @@ if __name__ == "__main__":
|
||||
|
||||
file_dataset_backtest = open("dataset_backtest.pkl", "rb")
|
||||
dataset_backtest = pickle.load(file_dataset_backtest)
|
||||
|
||||
|
||||
file_dataset_backtest.close()
|
||||
|
||||
##=============reload_dataset=============
|
||||
dataset.init(init_type=DataHandlerLP.IT_LS)
|
||||
dataset_backtest.init(init_type=DataHandlerLP.IT_LS)
|
||||
|
||||
|
||||
|
||||
##=============reinit qlib=============
|
||||
qlib.init(
|
||||
provider_uri=provider_uri,
|
||||
@@ -190,12 +187,12 @@ if __name__ == "__main__":
|
||||
auto_mount=False,
|
||||
)
|
||||
|
||||
Cal.calendar(freq="1min") #load the calendar for cache
|
||||
Cal.get_calendar_day(freq="1min") #load the calendar for cache
|
||||
Cal.calendar(freq="1min") # load the calendar for cache
|
||||
Cal.get_calendar_day(freq="1min") # load the calendar for cache
|
||||
|
||||
##=============test dataset
|
||||
xtrain, xtest = dataset.prepare(['train', 'test'])
|
||||
backtest_train, backtest_test = dataset_backtest.prepare(['train', 'test'])
|
||||
xtrain, xtest = dataset.prepare(["train", "test"])
|
||||
backtest_train, backtest_test = dataset_backtest.prepare(["train", "test"])
|
||||
|
||||
print(xtrain, xtest)
|
||||
print(backtest_train, backtest_test)
|
||||
|
||||
@@ -1479,7 +1479,7 @@ Operators = OpsWrapper()
|
||||
def register_all_ops(C):
|
||||
"""register all operator"""
|
||||
logger = get_module_logger("ops")
|
||||
|
||||
|
||||
Operators.reset()
|
||||
Operators.register(OpsList)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user