Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add autologging for scikit-learn (mlflow#3287)
* Add autologging for scikit-learn Signed-off-by: harupy <[email protected]> * Update sklearn's version Signed-off-by: harupy <[email protected]> * Remove unrelated file Signed-off-by: harupy <[email protected]> * rename Signed-off-by: harupy <[email protected]> * rename load_model Signed-off-by: harupy <[email protected]> * Remove blank line Signed-off-by: harupy <[email protected]> * Reorder imports Signed-off-by: harupy <[email protected]> * fix Signed-off-by: harupy <[email protected]> * DRY Signed-off-by: harupy <[email protected]> * Emit warning on older versions of sklearn Signed-off-by: harupy <[email protected]> * Use warnings.warn Signed-off-by: harupy <[email protected]> * Remove unused argument Signed-off-by: harupy <[email protected]> * Revert changes on requirements Signed-off-by: harupy <[email protected]> * Use LooseVersion Signed-off-by: harupy <[email protected]> * Fix _get_all_estimators Signed-off-by: harupy <[email protected]> * rename vars Signed-off-by: harupy <[email protected]> * Use backported all_estimators Signed-off-by: harupy <[email protected]> * Fix lint errors Signed-off-by: harupy <[email protected]> * Remove print Signed-off-by: harupy <[email protected]> * simplify code Signed-off-by: harupy <[email protected]> * Create sklearn directory Signed-off-by: harupy <[email protected]> * Move _all_estimators to utils Signed-off-by: harupy <[email protected]> * Remove link Signed-off-by: harupy <[email protected]> * fix Signed-off-by: harupy <[email protected]> * Fix active_run_exists' condition Signed-off-by: harupy <[email protected]> * Verify no children Signed-off-by: harupy <[email protected]> * Add experiment_id Signed-off-by: harupy <[email protected]> * Specify stacklevel Signed-off-by: harupy <[email protected]> * Wrap fit with try-except Signed-off-by: harupy <[email protected]> * Remove use_caplog Signed-off-by: harupy <[email protected]> * rename test Signed-off-by: harupy <[email protected]> * Remove temp_tracking_uri Signed-off-by: harupy <[email protected]> * Remove unused imports Signed-off-by: harupy <[email protected]> * Add docstring for _all_estimators Signed-off-by: harupy <[email protected]> * Fix assertions Signed-off-by: harupy <[email protected]> * Wrap score with try-except Signed-off-by: harupy <[email protected]> * fix Signed-off-by: harupy <[email protected]> * Add log assertion to test_autolog_marks_run_as_failed_when_fit_fails Signed-off-by: harupy <[email protected]> * indent Signed-off-by: harupy <[email protected]> * simplify code Signed-off-by: harupy <[email protected]> * Add failure reasons Signed-off-by: harupy <[email protected]> * Fix assertion order Signed-off-by: harupy <[email protected]> * Assert metrics is empty when score fails Signed-off-by: harupy <[email protected]> * minor fix Signed-off-by: harupy <[email protected]> * Assert after with Signed-off-by: harupy <[email protected]> * Use readable class name Signed-off-by: harupy <[email protected]> * Throw when fit fails Signed-off-by: harupy <[email protected]> * Rename active_run_exists to should_start_run Signed-off-by: harupy <[email protected]> * nit Signed-off-by: harupy <[email protected]> * fix if condition Signed-off-by: harupy <[email protected]> * pass sample_weight if both fit and score have it Signed-off-by: harupy <[email protected]> * Exclude property methods from patching Signed-off-by: harupy <[email protected]> * Chunk params to avoid hitting log_batch API limit Signed-off-by: harupy <[email protected]> * Fix args handling Signed-off-by: harupy <[email protected]> * Use all_estimators if sklearn.utils.all_estimators exists Signed-off-by: harupy <[email protected]> * Fix lint errors Signed-off-by: harupy <[email protected]> * Remove useless () Signed-off-by: harupy <[email protected]> * Fix test name Signed-off-by: harupy <[email protected]> * nit Signed-off-by: harupy <[email protected]> * Use model.fit if not parametrized Signed-off-by: harupy <[email protected]> * Temporarily add sklearn job Signed-off-by: harupy <[email protected]> * Add pytest Signed-off-by: harupy <[email protected]> * rerun Signed-off-by: harupy <[email protected]> * fix config Signed-off-by: harupy <[email protected]> * Fix install Signed-off-by: harupy <[email protected]> * do not run install-common.sh Signed-off-by: harupy <[email protected]> * Disable fail-fast Signed-off-by: harupy <[email protected]> * Remove sklearn.datasets Signed-off-by: harupy <[email protected]> * Add 0.22.2 Signed-off-by: harupy <[email protected]> * Try print_changed_only=True Signed-off-by: harupy <[email protected]> * Truncate dict value Signed-off-by: harupy <[email protected]> * Add test for value truncation Signed-off-by: harupy <[email protected]> * De-hardcode tests Signed-off-by: harupy <[email protected]> * Remove set_config Signed-off-by: harupy <[email protected]> * Use try_mlflow_log for mlflow.end_run Signed-off-by: harupy <[email protected]> * Use try-catch for _all_estimators Signed-off-by: harupy <[email protected]> * Fix waring message for scoring error Signed-off-by: harupy <[email protected]> * Mark autolog as experimental Signed-off-by: harupy <[email protected]> * Mark tests for autolog as large Signed-off-by: harupy <[email protected]> * Add test_fit_takes_Xy_as_keyword_arguments Signed-off-by: harupy <[email protected]> * Emit warning message when truncating key or value Signed-off-by: harupy <[email protected]> * De-hardcode x and y names Signed-off-by: harupy <[email protected]> * Fix mangled-signatures link Signed-off-by: harupy <[email protected]> * Add comments Signed-off-by: harupy <[email protected]> * Add doc for _get_args_for_score Signed-off-by: harupy <[email protected]> * Add large option Signed-off-by: harupy <[email protected]> * Apply truncation to expected dict Signed-off-by: harupy <[email protected]> * DRY Signed-off-by: harupy <[email protected]> * nit Signed-off-by: harupy <[email protected]> * De-hardcode sklearn version Signed-off-by: harupy <[email protected]> * Fix lint Signed-off-by: harupy <[email protected]> * De-hardcode model dir Signed-off-by: harupy <[email protected]> * Fix patch target Signed-off-by: harupy <[email protected]> * Use called_once_with Signed-off-by: harupy <[email protected]> * Add a new test case to test_both_fit_and_score_contain_sample_weight Signed-off-by: harupy <[email protected]> * nit Signed-off-by: harupy <[email protected]> * Remove unused function Signed-off-by: harupy <[email protected]> * nit Signed-off-by: harupy <[email protected]> * nit Signed-off-by: harupy <[email protected]> * DRY Signed-off-by: harupy <[email protected]> * Fix func order Signed-off-by: harupy <[email protected]> * Fix lint Signed-off-by: harupy <[email protected]> * Capitalize x Signed-off-by: harupy <[email protected]> * Override unbound methods Signed-off-by: harupy <[email protected]> * Introduce throw_if_try_mlflow_log_has_emitted_warnings fixture Signed-off-by: harupy <[email protected]> * Fix test_fit_takes_Xy_as_keyword_arguments Signed-off-by: harupy <[email protected]> * Add assertions for logged data Signed-off-by: harupy <[email protected]> * Add assert_called_once_with to test_call_fit_with_arguments_score_does_not_accept Signed-off-by: harupy <[email protected]> * Split Xy Signed-off-by: harupy <[email protected]> * Move log_metric to else clause Signed-off-by: harupy <[email protected]> * Fix lint errros Signed-off-by: harupy <[email protected]> * nit Signed-off-by: harupy <[email protected]> * Add docstring for autolog Signed-off-by: harupy <[email protected]> * Move pylint disable comments Signed-off-by: harupy <[email protected]> * nit Signed-off-by: harupy <[email protected]> * Fix fixture for try_mlflow_log Signed-off-by: harupy <[email protected]> * Add test_autolog_does_not_throw_when_mlflow_logging_fails Signed-off-by: harupy <[email protected]> * Fix lint Signed-off-by: harupy <[email protected]> * Replace key_is_none with val_is_none Signed-off-by: harupy <[email protected]> * Use MAX_ENTITY_KEY_LENGTH Signed-off-by: harupy <[email protected]> * Add comment for _MIN_SKLEARN_VERSION Signed-off-by: harupy <[email protected]> * Enhance comment for prop methods exclusion Signed-off-by: harupy <[email protected]> * Add todo for wrap & patch Signed-off-by: harupy <[email protected]> * bump sklearn Signed-off-by: harupy <[email protected]> * Update action config Signed-off-by: harupy <[email protected]> * Rename is_old_version Signed-off-by: harupy <[email protected]> * test _is_supported_version Signed-off-by: harupy <[email protected]> * Fix command Signed-off-by: harupy <[email protected]> * Fix _is_supported_version Signed-off-by: harupy <[email protected]> * Add continue-on-error Signed-off-by: harupy <[email protected]> * Emit a warning if test fail on an unsupported version Signed-off-by: harupy <[email protected]> * Add warning step Signed-off-by: harupy <[email protected]> * Fix workflow Signed-off-by: harupy <[email protected]> * Use set +e Signed-off-by: harupy <[email protected]> * debug Signed-off-by: harupy <[email protected]> * Fix condition Signed-off-by: harupy <[email protected]> * Simplify workflow Signed-off-by: harupy <[email protected]> * nit Signed-off-by: harupy <[email protected]> * Add comment on why include unsupported version Signed-off-by: harupy <[email protected]> * Update doc Signed-off-by: harupy <[email protected]> * black Signed-off-by: harupy <[email protected]> * nit Signed-off-by: harupy <[email protected]> * nit Signed-off-by: harupy <[email protected]> * fix comment Signed-off-by: harupy <[email protected]> * nit Signed-off-by: harupy <[email protected]> * Fix syntax Signed-off-by: harupy <[email protected]> * lint Signed-off-by: harupy <[email protected]>
- Loading branch information