def test_score_3():
 tpot_obj = TPOTRegressor(scoring='neg_mean_squared_error')
 tpot_obj._pbar = tqdm(total=1, disable=True)
 known_score = 8.967374340787371
 tpot_obj._optimized_pipeline = creator.Individual.from_string('ExtraTreesRegressor(GradientBoostingRegressor(input_matrix, 100.0, 0.11), 0.17999999999999999)', tpot_obj._pset)
 tpot_obj._fitted_pipeline = tpot_obj._toolbox.compile(expr=tpot_obj._optimized_pipeline)
 tpot_obj._fitted_pipeline.fit(training_features_r, training_classes_r)
 score = tpot_obj.score(testing_features_r, testing_classes_r)
 def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):
  return (abs((a - b)) <= max((rel_tol * max(abs(a), abs(b))), abs_tol))
 assert isclose(known_score, score)

def test_score_3 ( ) : tpot_obj = TPOTRegressor ( scoring = 'neg_mean_squared_error' ) tpot_obj . _pbar = tqdm ( total = 1 , disable = True ) known_score = 8.967374340787371 tpot_obj . _optimized_pipeline = creator . Individual . from_string ( 'ExtraTreesRegressor(GradientBoostingRegressor(input_matrix, 100.0, 0.11), 0.17999999999999999)' , tpot_obj . _pset ) tpot_obj . _fitted_pipeline = tpot_obj . _toolbox . compile ( expr = tpot_obj . _optimized_pipeline ) tpot_obj . _fitted_pipeline . fit ( training_features_r , training_classes_r ) score = tpot_obj . score ( testing_features_r , testing_classes_r ) def isclose ( a , b , rel_tol = 1e-09 , abs_tol = 0.0 ) : return ( abs ( ( a - b ) ) <= max ( ( rel_tol * max ( abs ( a ) , abs ( b ) ) ) , abs_tol ) ) assert isclose ( known_score , score )
assert that the tpotregressor score function outputs a known score for a fixed pipeline .