Skip to content

Commit

Permalink
Fixing typos after rebase.
Browse files Browse the repository at this point in the history
  • Loading branch information
freddyaboulton committed Jul 20, 2020
1 parent 3e63c68 commit 3268bc6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions evalml/pipelines/binary_classification_pipeline.py
Expand Up @@ -48,6 +48,7 @@ def predict_proba(self, X):
"""
return super().predict_proba(X)

@staticmethod
def _score(X, y, predictions, objective):
"""Given data, model predictions or predicted probabilities computed on the data, and an objective, evaluate and return the objective score.
"""
Expand Down
2 changes: 1 addition & 1 deletion evalml/pipelines/classification_pipeline.py
Expand Up @@ -120,8 +120,8 @@ def score(self, X, y, objectives):
y = pd.Series(y)

objectives = [get_objective(o) for o in objectives]
y_predicted, y_predicted_proba = self._compute_predictions(X, objectives)
y = self._encode_targets(y)
y_predicted, y_predicted_proba = self._compute_predictions(X, objectives)

def always_suitable(objective):
return True
Expand Down
11 changes: 1 addition & 10 deletions evalml/tests/automl_tests/test_automl.py
Expand Up @@ -184,22 +184,13 @@ def test_objective_score_raises(mock_score, X_y_binary, caplog):
X, y = X_y_binary
automl = AutoMLSearch(problem_type='binary', max_pipelines=1)

with pytest.raises(PipelineScoreError) as e:
automl.search(X, y)
out = caplog.text

assert msg in out
assert not np.isnan(e.scored_successfully.values()).any()

caplog.clear()
automl = AutoMLSearch(problem_type='binary', max_pipelines=1)
automl.search(X, y)
out = caplog.text

assert msg in out
pipeline_results = automl.results.get('pipeline_results')
assert len(pipeline_results) == 1
cv_scores_all = pipeline_results[0].get('cv_data')
cv_scores_all = pipeline_results[0].get('cv_data') # {})
scores = cv_scores_all[0]['all_objective_scores']
auc_score = scores.pop('AUC')
assert np.isnan(auc_score)
Expand Down

0 comments on commit 3268bc6

Please sign in to comment.