1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-07 13:00:58 +08:00

Add catboost config and notebook

This commit is contained in:
Jactus
2020-11-19 17:18:18 +08:00
parent df406d58a5
commit c91698287a
9 changed files with 415 additions and 87 deletions

View File

@@ -289,8 +289,12 @@ class DataHandlerLP(DataHandler):
getattr(self, pname).append(
init_instance_by_config(
proc,
None if (isinstance(data_loader, dict) and "module_path" in data_loader) else data_loader_module,
accept_types=processor_module.Processor))
None
if (isinstance(data_loader, dict) and "module_path" in data_loader)
else data_loader_module,
accept_types=processor_module.Processor,
)
)
self.process_type = process_type
super().__init__(instruments, start_time, end_time, data_loader, **kwargs)

View File

@@ -32,7 +32,10 @@ def get_level_index(df: pd.DataFrame, level=Union[str, int]) -> int:
def fetch_df_by_index(
df: pd.DataFrame, selector: Union[pd.Timestamp, slice, str, list], level: Union[str, int], fetch_orig=True,
df: pd.DataFrame,
selector: Union[pd.Timestamp, slice, str, list],
level: Union[str, int],
fetch_orig=True,
) -> pd.DataFrame:
"""
fetch data from `data` with `selector` and `level`
@@ -55,8 +58,12 @@ def fetch_df_by_index(
if fetch_orig:
for slc in idx_slc:
if slc != slice(None, None):
return df.loc[pd.IndexSlice[idx_slc],]
return df.loc[
pd.IndexSlice[idx_slc],
]
else:
return df
else:
return df.loc[pd.IndexSlice[idx_slc],]
return df.loc[
pd.IndexSlice[idx_slc],
]