CBA:
import xlwt
import numpy as np
import pandas as pd
from copy import deepcopy
from sklearn.metrics import accuracy_score, mean_absolute_error, f1_score, recall_score
from collections import OrderedDict
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import StratifiedKFold
from pathlib import Path
import matplotlib.pyplot as plt
from scipy.spatial.distance import pdist, squareform
from sklearn.svm import SVC
class CBA():
def __init__(self, X_pool, y_pool, labeled, budget, X_test, y_test):
self.X_pool = X_pool
self.y_pool = y_pool.astype(np.int)
self.X_test = X_test
self.y_test = y_test.astype(np.int)
self.labels = np.sort(np.unique(self.y_pool))
self.nClass = len(self.labels)
self.label