Skip to content

Commit

Permalink
Create model_ensemble_test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jun 1, 2024
1 parent 9017aa8 commit 51a812f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions model_ensemble/model_ensemble_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import unittest
from galactic_chain.model_ensemble import ModelEnsemble

class TestModelEnsemble(unittest.TestCase):
def setUp(self):
self.model1 = lambda x: x['A'] + x['B']
self.model2 = lambda x: x['A'] - x['B']
self.models = [self.model1, self.model2]

def test_bagging(self):
model_ensemble = ModelEnsemble(self.models)
ensemble = model_ensemble.bagging()
self.assertIsInstance(ensemble, BaggingClassifier)

if __name__ == '__main__':
unittest.main()

0 comments on commit 51a812f

Please sign in to comment.