1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-15 16:56:54 +08:00

Checking dataset empty (#647)

* Checking dataset empty

* add dataset checker
This commit is contained in:
you-n-g
2021-10-14 23:35:12 +08:00
committed by GitHub
parent 9a175d7507
commit 334b92ace7
21 changed files with 47 additions and 0 deletions

View File

@@ -169,6 +169,8 @@ class TabnetModel(Model):
col_set=["feature", "label"],
data_key=DataHandlerLP.DK_L,
)
if df_train.empty or df_valid.empty:
raise ValueError("Empty data from dataset, please check your dataset config.")
df_train.fillna(df_train.mean(), inplace=True)
x_train, y_train = df_train["feature"], df_train["label"]
x_valid, y_valid = df_valid["feature"], df_valid["label"]