Exemple #1
0
    def test_evaluate_model(self):

        # create a sample model
        my_model = Model(model_type='linreg')

        my_model.setup_feature_target(TestModel.x, TestModel.y)

        score = my_model.evaluate_model(my_model.x, my_model.y)

        self.assertAlmostEqual(score.mean(), 0.65, 1, msg='Unexpected score')
Exemple #2
0
    def test_setup_feature_target(self):

        # create a sample model
        my_model = Model(model_type='linreg')

        my_model.setup_feature_target(TestModel.x, TestModel.y)

        self.assertEqual(my_model.x.shape,
                         TestModel.x.shape,
                         msg='Shape mismatch!')

        self.assertEqual(my_model.y.shape,
                         TestModel.y.shape,
                         msg='Shape mismatch!')