diff --git a/BlackBoxAuditing/model_factories/DecisionTree.py b/BlackBoxAuditing/model_factories/DecisionTree.py index ada5e22a..10c7b23c 100644 --- a/BlackBoxAuditing/model_factories/DecisionTree.py +++ b/BlackBoxAuditing/model_factories/DecisionTree.py @@ -133,7 +133,7 @@ def list_to_tf_input(data, response_index, num_outcomes): """ Separates the outcome feature from the data and creates the onehot vector for each row. """ - matrix = np.matrix([row[:response_index] + row[response_index+1:] for row in data]) + matrix = np.array([row[:response_index] + row[response_index+1:] for row in data]) outcomes = np.asarray([row[response_index] for row in data], dtype=np.uint8) outcomes_onehot = (np.arange(num_outcomes) == outcomes[:, None]).astype(np.float32) diff --git a/BlackBoxAuditing/model_factories/NeuralNetwork.py b/BlackBoxAuditing/model_factories/NeuralNetwork.py index 591f6e18..bc943fd9 100644 --- a/BlackBoxAuditing/model_factories/NeuralNetwork.py +++ b/BlackBoxAuditing/model_factories/NeuralNetwork.py @@ -155,7 +155,7 @@ def list_to_tf_input(data, response_index, num_outcomes): """ Separates the outcome feature from the data and creates the onehot vector for each row. """ - matrix = np.matrix([row[:response_index] + row[response_index+1:] for row in data]) + matrix = np.array([row[:response_index] + row[response_index+1:] for row in data]) outcomes = np.asarray([row[response_index] for row in data], dtype=np.uint8) outcomes_onehot = (np.arange(num_outcomes) == outcomes[:, None]).astype(np.float32) diff --git a/BlackBoxAuditing/model_factories/SKLearnModelVisitor.py b/BlackBoxAuditing/model_factories/SKLearnModelVisitor.py index 8084bcdf..bc91f278 100644 --- a/BlackBoxAuditing/model_factories/SKLearnModelVisitor.py +++ b/BlackBoxAuditing/model_factories/SKLearnModelVisitor.py @@ -8,7 +8,7 @@ def __init__(self, trained_classifier, label_index): self.label_index = label_index def get_Xy(self, test_set): - X = np.matrix([row[:self.label_index] + row[self.label_index+1:] for row in test_set]) + X = np.array([row[:self.label_index] + row[self.label_index+1:] for row in test_set]) y = np.asarray([row[self.label_index] for row in test_set]) return X, y diff --git a/BlackBoxAuditing/model_factories/SVM.py b/BlackBoxAuditing/model_factories/SVM.py index 919cac39..c9c1e545 100644 --- a/BlackBoxAuditing/model_factories/SVM.py +++ b/BlackBoxAuditing/model_factories/SVM.py @@ -139,7 +139,7 @@ def list_to_tf_input(data, response_index, num_outcomes): """ Separates the outcome feature from the data. """ - matrix = np.matrix([row[:response_index] + row[response_index+1:] for row in data]) + matrix = np.array([row[:response_index] + row[response_index+1:] for row in data]) outcomes = np.asarray([row[response_index] for row in data], dtype=np.uint8) return matrix, outcomes