def test_score_2():
 tpot_obj = TPOTClassifier()
 tpot_obj._pbar = tqdm(total=1, disable=True)
 known_score = 0.986318199045
 tpot_obj._optimized_pipeline = creator.Individual.from_string('RandomForestClassifier(input_matrix)', tpot_obj._pset)
 tpot_obj._fitted_pipeline = tpot_obj._toolbox.compile(expr=tpot_obj._optimized_pipeline)
 tpot_obj._fitted_pipeline.fit(training_features, training_classes)
 score = tpot_obj.score(testing_features, testing_classes)
 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_2 ( ) : tpot_obj = TPOTClassifier ( ) tpot_obj . _pbar = tqdm ( total = 1 , disable = True ) known_score = 0.986318199045 tpot_obj . _optimized_pipeline = creator . Individual . from_string ( 'RandomForestClassifier(input_matrix)' , tpot_obj . _pset ) tpot_obj . _fitted_pipeline = tpot_obj . _toolbox . compile ( expr = tpot_obj . _optimized_pipeline ) tpot_obj . _fitted_pipeline . fit ( training_features , training_classes ) score = tpot_obj . score ( testing_features , testing_classes ) 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 tpotclassifier score function outputs a known score for a fixed pipeline .