How to use the composeml.label_times.object.LabelTimes function in composeml

To help you get started, we’ve selected a few composeml examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FeatureLabs / compose / composeml / label_times / deserialize.py View on Github external
def load_label_times(path, df):
    """Read the settings in json format from disk.

    Args:
        path (str) : Directory on disk to read from.
    """
    file = os.path.join(path, 'settings.json')
    assert os.path.exists(file), "settings not found: '%s'" % file

    with open(file, 'r') as file:
        settings = json.load(file)

    lt = LabelTimes(
        data=df.astype(settings['dtypes']),
        target_columns=settings['target_columns'],
        target_entity=settings['target_entity'],
        target_types=settings['target_types'],
        search_settings=settings['search_settings'],
        transforms=settings['transforms'],
    )

    return lt