From 58e95ee504d0aae183107222433ae730bb0490c2 Mon Sep 17 00:00:00 2001 From: Jeremy Kubica <104161096+jeremykubica@users.noreply.github.com> Date: Thu, 10 Oct 2024 10:33:21 -0400 Subject: [PATCH] Remove broken algorithm option --- src/resspect/database.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/resspect/database.py b/src/resspect/database.py index 85217965..c415db88 100644 --- a/src/resspect/database.py +++ b/src/resspect/database.py @@ -950,11 +950,12 @@ def classify(self, method: str, save_predictions=False, pred_dir=None, self.predicted_class, self.classprob, self.classifier = \ random_forest(self.train_features, self.train_labels, self.pool_features, **kwargs) - elif method == 'GradientBoostedTrees': - self.predicted_class, self.classprob, self.classifier = \ - gradient_boosted_trees(self.train_features, self.train_labels, - self.pool_features, **kwargs) + raise ValueError("GradientBoostedTrees is currently unimplemented.") + # TODO: Restore once GradientBoostedTrees is fixed. + # self.predicted_class, self.classprob, self.classifier = \ + # gradient_boosted_trees(self.train_features, self.train_labels, + # self.pool_features, **kwargs) elif method == 'KNN': self.predicted_class, self.classprob, self.classifier = \ knn(self.train_features, self.train_labels, @@ -972,10 +973,10 @@ def classify(self, method: str, save_predictions=False, pred_dir=None, nbg(self.train_features, self.train_labels, self.pool_features, **kwargs) else: - raise ValueError("The only classifiers implemented are" + - "'RandomForest', 'GradientBoostedTrees'," + - "'KNN', 'MLP' and NB'." + - "\n Feel free to add other options.") + raise ValueError( + "The only classifiers implemented are 'RandomForest', 'KNN', 'MLP', " + "'SVM' and 'NB'.\nFeel free to add other options." + ) # estimate classification for validation sample self.validation_class = \ @@ -1213,10 +1214,10 @@ def make_query_budget(self, budgets, strategy='UncSampling', screen=False) -> li Budgets for 4m and 8m respectively. strategy: str (optional) Strategy used to choose the most informative object. - Current implementation accepts 'UncSampling' and + Current implementation accepts 'UncSampling' 'RandomSampling', 'UncSamplingEntropy', 'UncSamplingLeastConfident', 'UncSamplingMargin', - 'QBDMI', 'QBDEntropy', . Default is `UncSampling`. + 'QBDMI', and 'QBDEntropy'. Default is `UncSampling`. screen: bool (optional) If true, display on screen information about the displacement in order and classificaion probability due to