Пример #1
0
    try:
        with open("config.info", "r") as f:
            for line in f:
                if ("=" in line) and ("#" not in line):
                    tokens = [w.strip() for w in line.split("=")]
                    config_parameters[tokens[0]] = tokens[1]
    except IOError as e:
        print("I/O error ({}): {}".format(e.errno, e.sterror))

    pp = pprint.PrettyPrinter(indent=1)
    pp.pprint(config_parameters)

    # get table from the TEGA SQL database

    dg = DataHandler(config_parameters)  # create DataHandler object
    dg.download_or_load()  # either download tables or load from local drive
    dg.show_table(4)

    # create customer profile data frame

    fe = CustProfileCreator(dg.dwnl_tbl, config_parameters)
    fe.data_summary()
    fe.show_mosaic_representation()
    fe.show_cust_state_representation()
    fe.show_cust_age_representation()
    fe.create_customer_features()
    print("creating customer profile...")
    fe.create_profile()

    print(
        "customers included in the profile belong to the following {} classes:{}"