def gold_miner_mold(): gm = GoldMiner() gm.data = pickle_load("cleaned_data")[:20] print(len(gm.data)) print(len(gm.data[0])) start = time.time() gm.mold() print(len(gm.data[0])) print("elapse {0} seconds".format(time.time() - start))
def cast_hound(): h = Hound() data = smart_decode(pickle_load("train_data"), cast=True)[:10] h.x_predict, h.y_predict = split_x_y(data) h.load_model() h.predict() h.print_info() data = list(map(lambda x, y: x + y, [line[:4] for line in data], h.prediction.astype(unicode).tolist())) for line in data: print(len("\t".join(line)))
def gold_miner_hive_test(): gm = GoldMiner() gm.data = smart_decode(pickle_load("raw_data"), cast=True) gm.pan() print(len(gm.data)) gm.smelt()
def train_hound(): h = Hound() h.x_train, h.y_train = split_x_y(smart_decode(pickle_load("train_data"), cast=True)) h.train() h.save_model() h.print_info()
def transform(): pickle_dump("id_content", {line[0]: line[1] for line in pickle_load("raw")})