Skip to content

Commit

Permalink
🐛 fix missing aliases (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiWeiss authored Feb 3, 2023
1 parent 04fbec4 commit 73e54eb
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 4 deletions.
2 changes: 2 additions & 0 deletions tests_unit/quantifiers_tests/test_mean_softmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def test_string_representation(self):
isinstance(QuantifierRegistry.find("mean_softmax"), MeanSoftmax)
)
self.assertTrue(isinstance(QuantifierRegistry.find("ensembling"), MeanSoftmax))
self.assertTrue(isinstance(QuantifierRegistry.find("MS"), MeanSoftmax))
self.assertTrue(isinstance(QuantifierRegistry.find("MeanSoftmax"), MeanSoftmax))

def test_is_confidence(self):
self.assertTrue(MeanSoftmax.is_confidence())
Expand Down
4 changes: 4 additions & 0 deletions tests_unit/quantifiers_tests/test_mutual_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def test_string_representation(self):
self.assertTrue(
isinstance(QuantifierRegistry.find("mutu_info"), MutualInformation)
)
self.assertTrue(isinstance(QuantifierRegistry.find("MI"), MutualInformation))
self.assertTrue(
isinstance(QuantifierRegistry.find("MutualInformation"), MutualInformation)
)

def test_is_confidence(self):
self.assertFalse(MutualInformation.is_confidence())
Expand Down
8 changes: 8 additions & 0 deletions tests_unit/quantifiers_tests/test_one_shot_classifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ def test_string_representation(self):
self.assertTrue(
isinstance(QuantifierRegistry.find("PCS"), PredictionConfidenceScore)
)
self.assertTrue(
isinstance(
QuantifierRegistry.find("PredictionConfidenceScore"),
PredictionConfidenceScore,
)
)
self.assertTrue(
isinstance(
QuantifierRegistry.find("prediction_confidence_score"),
Expand Down Expand Up @@ -140,6 +146,7 @@ class TestSoftmax(TestCase):
def test_string_representation(self):
self.assertTrue(isinstance(QuantifierRegistry.find("softmax"), MaxSoftmax))
self.assertTrue(isinstance(QuantifierRegistry.find("max_softmax"), MaxSoftmax))
self.assertTrue(isinstance(QuantifierRegistry.find("MaxSoftmax"), MaxSoftmax))

def test_is_confidence(self):
self.assertTrue(MaxSoftmax.is_confidence())
Expand Down Expand Up @@ -213,6 +220,7 @@ def test_string_representation(self):
self.assertTrue(
isinstance(QuantifierRegistry.find("SoftmaxEntropy"), SoftmaxEntropy)
)
self.assertTrue(isinstance(QuantifierRegistry.find("SE"), SoftmaxEntropy))

def test_is_confidence(self):
self.assertFalse(SoftmaxEntropy.is_confidence())
Expand Down
4 changes: 4 additions & 0 deletions tests_unit/quantifiers_tests/test_predictive_entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def test_string_representation(self):
self.assertTrue(
isinstance(QuantifierRegistry.find("pred_entropy"), PredictiveEntropy)
)
self.assertTrue(isinstance(QuantifierRegistry.find("PE"), PredictiveEntropy))
self.assertTrue(
isinstance(QuantifierRegistry.find("PredictiveEntropy"), PredictiveEntropy)
)

def test_is_confidence(self):
self.assertFalse(PredictiveEntropy.is_confidence())
Expand Down
3 changes: 3 additions & 0 deletions tests_unit/quantifiers_tests/test_stddev.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def test_string_representation(self):
isinstance(QuantifierRegistry.find("standard_deviation"), StandardDeviation)
)
self.assertTrue(isinstance(QuantifierRegistry.find("std"), StandardDeviation))
self.assertTrue(
isinstance(QuantifierRegistry.find("StandardDeviation"), StandardDeviation)
)
self.assertTrue(
isinstance(QuantifierRegistry.find("stddev"), StandardDeviation)
)
Expand Down
3 changes: 3 additions & 0 deletions tests_unit/quantifiers_tests/test_variation_ratio.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def test_string_representation(self):
isinstance(QuantifierRegistry.find("var_ratio"), VariationRatio)
)
self.assertTrue(isinstance(QuantifierRegistry.find("VR"), VariationRatio))
self.assertTrue(
isinstance(QuantifierRegistry.find("VariationRatio"), VariationRatio)
)

def test_is_confidence(self):
self.assertFalse(VariationRatio.is_confidence())
Expand Down
2 changes: 1 addition & 1 deletion uncertainty_wizard/quantifiers/mean_softmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MeanSoftmax(ConfidenceQuantifier):
# docstr-coverage:inherited
@classmethod
def aliases(cls) -> List[str]:
return ["mean_softmax", "ensembling", "ms"]
return ["mean_softmax", "ensembling", "ms", "MeanSoftmax"]

# docstr-coverage:inherited
@classmethod
Expand Down
2 changes: 1 addition & 1 deletion uncertainty_wizard/quantifiers/mutual_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def problem_type(cls) -> ProblemType:
# docstr-coverage:inherited
@classmethod
def aliases(cls) -> List[str]:
return ["mutu_info", "mutual_information", "mi"]
return ["mutu_info", "mutual_information", "mi", "MutualInformation"]

# docstr-coverage:inherited
@classmethod
Expand Down
2 changes: 1 addition & 1 deletion uncertainty_wizard/quantifiers/predictive_entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class PredictiveEntropy(UncertaintyQuantifier):
# docstr-coverage:inherited
@classmethod
def aliases(cls) -> List[str]:
return ["predictive_entropy", "pred_entropy", "PE"]
return ["predictive_entropy", "pred_entropy", "PE", "PredictiveEntropy"]

# docstr-coverage:inherited
@classmethod
Expand Down
2 changes: 1 addition & 1 deletion uncertainty_wizard/quantifiers/variation_ratio.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def problem_type(cls) -> ProblemType:
# docstr-coverage:inherited
@classmethod
def aliases(cls) -> List[str]:
return ["variation_ratio", "vr", "var_ratio"]
return ["variation_ratio", "vr", "var_ratio", "VariationRatio"]

# docstr-coverage:inherited
@classmethod
Expand Down

0 comments on commit 73e54eb

Please sign in to comment.