def run_bucket_test(self):
        trainer = Trainer(self.test_training_file)
        trainer.generate_training_set(10000)

        match_file = open(self.test_training_file, 'rb')
        training_matches = pickle.load(match_file)
        match_file.close()

        clf = RandomForestClassifier(n_estimators=10, random_state=0)
        clf = clf.fit([eval(t.features) for t in training_matches], [int(t.matchpct) for t in training_matches])

        trainer = Trainer(self.test_training_file)

        num_matches = 0
        num_lastname_matches = 0
        num_lastname_and_state_matches = 0
        num_neither_matches = 0

        rows = []
        human_names = {}

        for row in csv.reader(open(trainer.input_file), delimiter=',', quotechar='"'):
            row = dict(zip(trainer.input_file_fields, row))
            if row['contributor_gender'] == '':
                continue;
            row['last_name'] = HumanName(row['full_name']).last.upper()
            rows.append(row)

        cnt = 0
        for i in range(0, len(rows) - 1):
            print i
            for j in range(0, len(rows) - 1):
                if i == j:
                    continue
                if rows[i]['contributor_ext_id'] == rows[j]['contributor_ext_id']:
                    num_matches += 1
                    if rows[i]['last_name'] == rows[j]['last_name']:
                          num_lastname_matches += 1
                          if rows[i]['state'] == rows[j]['state']:
                                num_lastname_and_state_matches += 1
                    else:
                        num_neither_matches += 1
                        print '*'
                        print rows[i]
                        print rows[j]

        print num_matches
        print num_lastname_matches
        print num_lastname_and_state_matches
        print num_neither_matches

        print float(num_lastname_matches) / float(num_matches)
        print float(num_lastname_and_state_matches) / float(num_matches)
dataset/ETHPy150Open huffpostdata/campfin-linker/campfin/tester.py/Tester.run_bucket_test/original