<s> __author__ = '<STR_LIT>' <EOL> __author__ = '<STR_LIT>' <EOL> import unittest <EOL> from learnpy . Problem import Problem <EOL> from learnpy . models . ModelUtil import * <EOL> class NaiveBayesTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . problem = Problem ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . problem . set_label ( "<STR_LIT:Name>" ) <EOL> self . problem . set_model ( "<STR_LIT>" ) <EOL> self . data = self . problem . data <EOL> self . model = self . problem . model <EOL> def tearDown ( self ) : <EOL> self . problem = None <EOL> self . data = None <EOL> def test_prob_stats ( self ) : <EOL> prob = self . model . prob_hub [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT:a>' ] <EOL> self . assertEqual ( <NUM_LIT> , round ( prob , <NUM_LIT:2> ) ) <EOL> prob = self . model . prob_hub [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT:b>' ] <EOL> self . assertEqual ( <NUM_LIT> , round ( prob , <NUM_LIT:2> ) ) <EOL> def test_mean_std ( self ) : <EOL> mean , std = get_mean_std ( self . data [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( <NUM_LIT> , round ( mean , <NUM_LIT:4> ) ) <EOL> self . assertEqual ( <NUM_LIT> , round ( std , <NUM_LIT:4> ) ) <EOL> suite = unittest . TestLoader ( ) . loadTestsFromTestCase ( NaiveBayesTest ) <EOL> unittest . TextTestRunner ( ) . run ( suite ) </s>
