ray-project / tune-sklearn

A drop-in replacement for Scikit-Learn’s GridSearchCV / RandomizedSearchCV -- but with cutting edge hyperparameter tuning techniques.
https://docs.ray.io/en/master/tune/api_docs/sklearn.html
Apache License 2.0
465 stars 52 forks source link

Since Ray-2.7.0, fetch_trial_dataframes is deprecated and raise an DeprecationWarning exception #273

Closed dhavalsalwala closed 11 months ago

dhavalsalwala commented 1 year ago

Since Ray-2.7.0 calling fetch_trial_dataframes() raises an exception.

Code in tune_sklearn-0.4.6: tune_sklearn/tune_basesearch.py", line 778, in _format_results

    def _format_results(self, n_splits, out):
        """Helper to generate the ``cv_results_`` dictionary.

        Args:
            n_splits (int): integer specifying the number of folds when doing
                cross-validation.
            out (:obj:`ExperimentAnalysis`): Object returned by `tune.run`.

        Returns:
            results (:obj:`dict`): Dictionary of results to use for the
                interface's ``cv_results_``.

        """
        trials = [
            trial for trial in out.trials if trial.status == Trial.TERMINATED
        ]
        trial_dirs = [trial.logdir for trial in trials]
        # The result dtaframes are indexed by their trial logdir
        trial_dfs = out.fetch_trial_dataframes()

Code in ray-2.7.0: ray/tune/analysis/experiment_analysis.py", line 745, in fetch_trial_dataframes

    def fetch_trial_dataframes(self) -> Dict[str, DataFrame]:
        raise DeprecationWarning(
            "`fetch_trial_dataframes` is deprecated. "
            "Access the `trial_dataframes` property instead."
        )
TheDohn commented 12 months ago

Possibly related: https://github.com/ray-project/ray/issues/40554

justinvyu commented 12 months ago

This will be fixed by https://github.com/ray-project/tune-sklearn/pull/272. I will update this thread once the patch is released.