1
0
Fork 0
QuaPy/quapy/tests/test_hierarchy.py

30 lines
1010 B
Python
Raw Normal View History

2022-05-25 19:14:33 +02:00
import unittest
from sklearn.linear_model import LogisticRegression
from quapy.method.aggregative import *
class HierarchyTestCase(unittest.TestCase):
def test_aggregative(self):
lr = LogisticRegression()
for m in [CC(lr), PCC(lr), ACC(lr), PACC(lr)]:
self.assertEqual(isinstance(m, AggregativeQuantifier), True)
def test_binary(self):
lr = LogisticRegression()
for m in [HDy(lr)]:
self.assertEqual(isinstance(m, BinaryQuantifier), True)
def test_probabilistic(self):
lr = LogisticRegression()
for m in [CC(lr), ACC(lr)]:
2024-01-29 09:43:29 +01:00
self.assertEqual(isinstance(m, AggregativeCrispQuantifier), True)
2023-11-15 10:55:13 +01:00
self.assertEqual(isinstance(m, AggregativeSoftQuantifier), False)
2022-05-25 19:14:33 +02:00
for m in [PCC(lr), PACC(lr)]:
2024-01-29 09:43:29 +01:00
self.assertEqual(isinstance(m, AggregativeCrispQuantifier), False)
2023-11-15 10:55:13 +01:00
self.assertEqual(isinstance(m, AggregativeSoftQuantifier), True)
2022-05-25 19:14:33 +02:00
if __name__ == '__main__':
unittest.main()