Example #1
0
def test_to_pickle(entityset):
    dirname = os.path.dirname(integration_data.__file__)
    path = os.path.join(dirname, 'test_entityset.p')
    if os.path.exists(path):
        shutil.rmtree(path)
    entityset.to_pickle(path)
    new_es = ft.read_pickle(path)
    assert entityset.__eq__(new_es, deep=True)
    shutil.rmtree(path)
Example #2
0
def test_to_pickle(entityset):
    dirname = os.path.dirname(integration_data.__file__)
    path = os.path.join(dirname, 'test_entityset.p')
    if os.path.exists(path):
        shutil.rmtree(path)
    entityset.to_pickle(path)
    new_es = ft.read_pickle(path)
    assert entityset.__eq__(new_es, deep=True)
    shutil.rmtree(path)
Example #3
0
    encodeOutput = args.encodeOutput
    if not encodeOutput:
        sys.exit("Missing required argument: encodeOutput")

    # Assign WorkingDir to Feature Tools
    os.environ['FEATURETOOLS_DIR'] = workingDir

    # Import featuretools now that we've correctly set the env var.
    import featuretools as ft
    from featuretools.selection import remove_low_information_features

    # Unzip and Unpickle Input
    dir_name = workingDir + "output.pkl"
    shutil.unpack_archive(inFile.name, dir_name, 'zip')

    es = ft.read_pickle(dir_name, load_data=True)

    if not es:
        sys.exit("Missing required argument: entity set")

    # Adjust Entity Set
    cutoff_times = es['transactions'].df[['Transaction Id', 'End Time', 'Outcome']]

    pd.options.display.max_columns = 500

    fm, features = ft.dfs(entityset=es,
                          target_entity='transactions',
                          agg_primitives=aggPrimitives,
                          trans_primitives=transPrimitives,
                          max_depth=maxDepth,
                          cutoff_time=cutoff_times[1000:],