def _feature_by_type_splits(config, train_mode): if train_mode: feature_by_type_split = Step(name='feature_by_type_split', transformer=fe.DataFrameByTypeSplitter( **config.dataframe_by_type_splitter), input_data=['input'], adapter={ 'X': ([('input', 'X')]), }, cache_dirpath=config.env.cache_dirpath) feature_by_type_split_valid = Step( name='feature_by_type_split_valid', transformer=feature_by_type_split, input_data=['input'], adapter={ 'X': ([('input', 'X_valid')]), }, cache_dirpath=config.env.cache_dirpath) return feature_by_type_split, feature_by_type_split_valid else: feature_by_type_split = Step(name='feature_by_type_split', transformer=fe.DataFrameByTypeSplitter( **config.dataframe_by_type_splitter), input_data=['input'], adapter={ 'X': ([('input', 'X')]), }, cache_dirpath=config.env.cache_dirpath) return feature_by_type_split
def _feature_by_type_splits(config, train_mode): if train_mode: feature_by_type_split = Step(name='feature_by_type_split', transformer=fe.DataFrameByTypeSplitter(**config.dataframe_by_type_splitter), input_data=['input'], adapter=Adapter({'X': E('input', 'X')}), experiment_directory=config.pipeline.experiment_directory) feature_by_type_split_valid = Step(name='feature_by_type_split_valid', transformer=feature_by_type_split, input_data=['input'], adapter=Adapter({'X': E('input', 'X_valid')}), experiment_directory=config.pipeline.experiment_directory) return feature_by_type_split, feature_by_type_split_valid else: feature_by_type_split = Step(name='feature_by_type_split', transformer=fe.DataFrameByTypeSplitter(**config.dataframe_by_type_splitter), input_data=['input'], adapter=Adapter({'X': E('input', 'X')}), experiment_directory=config.pipeline.experiment_directory) return feature_by_type_split