Julian Nowak
03/15/2024, 9:16 AMDataseterror saving 'none' to a 'dataset' is not allowed
error.
I have a dynamic pipelines for certain classifiers (e.g., seperate for XGBoost, CNN etc.) On training, I define scaler, that should be saved to dataset as a pickle object, so I can use the same scaler on validation etc.
When using XGBoost, I want to define Scaler as None
, but I got the Dataseterror saving 'none' to a 'dataset' is not allowed
. Is there a smart way to save it anyway?Merel
03/15/2024, 2:06 PMMerel
03/15/2024, 2:09 PMNok Lam Chan
03/15/2024, 4:55 PMJulian Nowak
03/19/2024, 3:14 PMpickle.PickleDataset,
as a way to overcome this for now I perform:
scaler = 0 # TODO change to None
if architecture != "xgboost":
X, scaler = _scale(X)
Julian Nowak
03/19/2024, 3:14 PMnode(
func=split_data,
inputs=[
"model_input_data",
"params:architecture",
"params:model_options",
],
outputs=[
"X_train",
"X_test",
"y_train",
"y_test",
"sample_weights",
"scaler",
],
name="split_data_node",
tags="split",
),
Julian Nowak
03/19/2024, 3:16 PMJulian Nowak
03/19/2024, 3:17 PMNone
would , but maybe saving it as 0 is simpler than creating a custom dataset.
btw pickle normally accepts None
to be saved