@@ -21,7 +21,8 @@ def setUpClass(cls):
2121
2222 def test_adaboost (self ):
2323 learn = SklAdaBoostClassificationLearner ()
24- results = CrossValidation (self .iris , [learn ], k = 3 )
24+ cv = CrossValidation (k = 3 )
25+ results = cv (self .iris , [learn ])
2526 ca = CA (results )
2627 self .assertGreater (ca , 0.9 )
2728 self .assertLess (ca , 0.99 )
@@ -34,7 +35,8 @@ def test_adaboost_base_estimator(self):
3435 base_estimator = stump_estimator , n_estimators = 5 )
3536 tree = SklAdaBoostClassificationLearner (
3637 base_estimator = tree_estimator , n_estimators = 5 )
37- results = CrossValidation (self .iris , [stump , tree ], k = 4 )
38+ cv = CrossValidation (k = 4 )
39+ results = cv (self .iris , [stump , tree ])
3840 ca = CA (results )
3941 self .assertLessEqual (ca [0 ], ca [1 ])
4042
@@ -62,7 +64,8 @@ def test_adaboost_adequacy(self):
6264
6365 def test_adaboost_reg (self ):
6466 learn = SklAdaBoostRegressionLearner ()
65- results = CrossValidation (self .housing , [learn ], k = 3 )
67+ cv = CrossValidation (k = 3 )
68+ results = cv (self .housing , [learn ])
6669 _ = RMSE (results )
6770
6871 def test_adaboost_reg_base_estimator (self ):
@@ -71,7 +74,8 @@ def test_adaboost_reg_base_estimator(self):
7174 tree_estimator = SklTreeRegressionLearner ()
7275 stump = SklAdaBoostRegressionLearner (base_estimator = stump_estimator )
7376 tree = SklAdaBoostRegressionLearner (base_estimator = tree_estimator )
74- results = CrossValidation (self .housing , [stump , tree ], k = 3 )
77+ cv = CrossValidation (k = 3 )
78+ results = cv (self .housing , [stump , tree ])
7579 rmse = RMSE (results )
7680 self .assertGreaterEqual (rmse [0 ], rmse [1 ])
7781
0 commit comments