WW Accessor: Updating objectives#2185
Conversation
| from evalml.objectives import LeadScoring | ||
|
|
||
|
|
||
| def test_lead_scoring_objective(X_y_binary): |
There was a problem hiding this comment.
This test does two things: run automl with lead scoring and test it on small data not related to automl so I'm splitting it into two so we can cover the part that doesn't run automl.
There was a problem hiding this comment.
Thanks for the explanation!
Codecov Report
@@ Coverage Diff @@
## 2035-use-ww-accessor #2185 +/- ##
======================================================
+ Coverage 27.4% 31.3% +3.9%
======================================================
Files 295 295
Lines 24336 24335 -1
======================================================
+ Hits 6657 7594 +937
+ Misses 17679 16741 -938
Continue to review full report at Codecov.
|
| --ignore evalml/tests/model_understanding_tests --ignore evalml/tests/objective_tests \ | ||
| -k "not test_save" | ||
| --ignore evalml/tests/model_understanding_tests \ | ||
| -k "not test_save and not objective_test_uses_automl" |
There was a problem hiding this comment.
Needed to deselect the objective tests that run automl
jeremyliweishih
left a comment
There was a problem hiding this comment.
lgtm once tests pass!
| y_true = _convert_woodwork_types_wrapper(y_true.to_series()).to_numpy() | ||
| y_predicted = _convert_woodwork_types_wrapper(y_predicted.to_series()).to_numpy() | ||
| y_true = y_true.to_numpy() | ||
| y_predicted = y_predicted.to_numpy() |
| assert not np.isnan(predictions.to_series()).values.any() | ||
| assert not np.isnan(pipeline.predict_proba(X).to_dataframe()).values.any() | ||
| assert not np.isnan(predictions).values.any() | ||
| assert not np.isnan(pipeline.predict_proba(X)).values.any() |
There was a problem hiding this comment.
Lol go home codecov you're drunk 😆
Was this change required by lint? Or just seemed like a good idea? I understand you'll get this and the other objective_test_uses_automl tests green in a separate PR.
There was a problem hiding this comment.
It just seemed like a good idea cause I'm now trained to delete all to_series() and to_dataframe() that I see 😂
|
|
||
| out = ww.DataColumn(fraud_cost.decision_function(y_predicted, 5, extra_columns)) | ||
| pd.testing.assert_series_equal(out.to_series(), y_true, check_dtype=False, check_names=False) | ||
| out = pd.Series(fraud_cost.decision_function(y_predicted, 5, extra_columns)) |
There was a problem hiding this comment.
Is this necessary? I would assume the output of decision_function is already a pandas series
There was a problem hiding this comment.
It's not! Good catch
| from evalml.objectives import LeadScoring | ||
|
|
||
|
|
||
| def test_lead_scoring_objective(X_y_binary): |
There was a problem hiding this comment.
Thanks for the explanation!
* WW Accessor: Update demo datasets, preprocessing, and utils (#2172) * Update demos, utils, and preprocessing * Updating make test commands * Update ww requirement * Add test that infer_feature_types preserves schema * Add test that infer_feature_types raises errors with invalid schema * load_data always returns woodwork info. Deleted return_pandas * Updating docstrings * Release notes for first PR * Deleting redundant tests * update test name * WW 0.2.0: Update Data Checks (#2182) * Updating data checks * Undo accidental edit * Fixing typo where we assign to ww.init * WW Accessor: Updating objectives (#2185) * Updating objectives * Deleting superfluous pd.Series * WW Accessor: Updating Components (#2191) * Update components - first commit * Update delayed_features_transformer to not use assign * Fixing tests * Skipping Boolean with Nan test in imputers * Fixing base sampler _prepare_data * Fixing target imputer null bool test * Fix test skips * Addressing comments * Clean up sampler tests * Editing docstrings * Update to ww 0.3.0 * Fixing components that didn't have merge conflicts * WW 0.2.0 Update: Updating pipelines (#2205) * Updating pipelines * Fixing docstrings * Fix stacked test * Add tests to check input data not modified * Use rename in component graph * WW Accessor: Update model understanding (#2247) * Update model understanding module * Removing unused import * WW Accessor: Update Automl (#2243) * Updating pipelines * Fixing docstrings * Fix stacked test * Update automl * Update to preserve schema * Preserve schema in train_pipelines/score_pipelines * No ww drop * Update standard scaler * Use weak ref feture branch * Add tests to check input data not modified * Use weak-ref branch * Use weak ref branch * Fixing tests * Set ww back to 0.3.0 * Adding objective tests that use automl * Add back minimal-dependencies-flag * Fix test command * Updating docstrings adding dask test to check schema is sent * Fixing import order in test_dask_engine * Fixing last remaining docstrings * Fix typo in ignore command * Use ww init series * No doctest modules yet * Fix docstrings & use schemas stored in automl_config * WW Update: Update docs and docstrings (#2292) * Fixing docs and docstrings * Update docstring in highly_null_data_check * Delete warning from init * Remove print(X.ww) * Fixing notebook python version :( * Update release notes * Delete _convert_woodwork_types_wrapper completely * Fixing coverage * Add back standard scaler try * Remove _convert_woodwork_types_wrapper from docs' * Linting docs * Merging main * Fix release notes

Pull Request Description
Updates objectives (and confusion_matrix implementation for the cost-benefit objective). Had to manually deselect some tests because they actually run automl.
See the roadmap here
After creating the pull request: in order to pass the release_notes_updated check you will need to update the "Future Release" section of
docs/source/release_notes.rstto include this pull request by adding :pr:123.