ballet.util.io module

ballet.util.io.load_table_from_config(input_dir, config)[source]

Load table from table config dict

Parameters
  • input_dir (Union[str, PathLike]) – directory containing input files

  • config (dict) – mapping with keys ‘name’, ‘path’, and ‘pd_read_kwargs’.

Return type

DataFrame

ballet.util.io.read_tabular(filepath)[source]

Read tabular object in HDF5 or pickle format

Parameters

filepath (Union[str, PathLike]) – path to read to; must end in ‘.h5’ or ‘.pkl’

ballet.util.io.save_features(X, output_dir, name='features')[source]

Save built features to output directory

ballet.util.io.save_model(model, output_dir, name='model')[source]
ballet.util.io.save_predictions(ypred, output_dir, name='predictions')[source]

Save predictions to output directory

ballet.util.io.save_targets(y, output_dir, name='target')[source]

Save built target to output directory

ballet.util.io.write_tabular(obj, filepath)[source]

Write tabular object in HDF5 or pickle format

Parameters
  • obj (Union[ndarray, DataFrame]) – tabular object to write

  • filepath (Union[str, PathLike]) – path to write to; must end in ‘.h5’ or ‘.pkl’