def _test_avg(self): dataset = nc_rna_reader.toNumpy() train_set_size = 200 X_train_full, y_train_full, X_test_full, y_test_full = dataset X_train, y_train = self.get_sub_set_with_size([X_train_full, y_train_full], train_set_size) X_test, y_test = self.get_sub_set_with_size([X_test_full, y_test_full], 10000) train_set = (X_train, y_train) test_set_original = (X_test, y_test) clf_class = LinearSVC for split_r in numpy.arange(0.1, 1.0, 0.1): ra = RA(clf_class, ac_method="ac", subsample_count=200, split_r=split_r) ra.fit(train_set) err = self.compute_avg_error(ra, test_set_original) print "%f\t%f" % (split_r, err)
def _test_avg(self): dataset = rcv1_binary_reader.toNumpy() train_set_size = 300 X_train_full, y_train_full, X_test_full, y_test_full = dataset X_train, y_train = self.get_sub_set_with_size([X_train_full, y_train_full], train_set_size) X_test, y_test = self.get_sub_set_with_size([X_test_full, y_test_full], 10000) train_set = (X_train, y_train) test_set_original = (X_test, y_test) clf_class = LogisticRegression for split_r in numpy.arange(0.1, 1.0, 0.1): ra = RA(clf_class, ac_method = 'ac', subsample_count = 200, split_r=split_r) ra.fit(train_set) err = self.compute_avg_error(ra, test_set_original) print split_r, err