Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoML reload gives me typeError: '<' not supported between instances of 'float' and 'str' #681

Open
bardamchop opened this issue Dec 5, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@bardamchop
Copy link

My process crashes after 9 hours or so and rerunning
automl = AutoML(results_path=f"./model/{final_assets}_{shift_l}", mode="Optuna",
total_time_limit=48* 3600,
optuna_time_budget=3600)

I am getting the following error
TypeError: '<' not
supported between instances of 'float' and 'str'

File /anaconda/envs/azureml_py310_sdkv2/lib/python3.10/site-packages/supervised/base_automl.py:485, in BaseAutoML._perform_model_stacking(self)
482 if self._fairness_metric is not None:
483 # get only fair models if we train with sensitive features
484 ldb = ldb[ldb["is_fair"]]
--> 485 ldb = ldb.sort_values(by="metric_value", ascending=True)
486 models_map = {m.get_name(): m for m in self._models if not m._is_stacked}
487 self._stacked_models = []

File /anaconda/envs/azureml_py310_sdkv2/lib/python3.10/site-packages/pandas/core/frame.py:6955, in DataFrame.sort_values(self, by, axis, ascending, inplace, kind, na_position, ignore_index, key)
6952 if isinstance(ascending, (tuple, list)):
6953 ascending = ascending[0]
-> 6955 indexer = nargsort(
6956 k, kind=kind, ascending=ascending, na_position=na_position, key=key
6957 )
6958 else:
6959 if inplace:

File /anaconda/envs/azureml_py310_sdkv2/lib/python3.10/site-packages/pandas/core/sorting.py:483, in nargsort(items, kind, ascending, na_position, key, mask)
481 non_nans = non_nans[::-1]
482 non_nan_idx = non_nan_idx[::-1]
--> 483 indexer = non_nan_idx[non_nans.argsort(kind=kind)]
484 if not ascending:
485 indexer = indexer[::-1]

I had Pandas 2.1.3 but I also tried with 2.1.0 with the same error
!{sys.executable} -m pip install --upgrade xgboost==2.0.1
!{sys.executable} -m pip install pandas==2.1.0
!{sys.executable} -m pip install --upgrade mljar-supervised

Love this package so far by the way!

@pplonski pplonski added bug Something isn't working help wanted Extra attention is needed labels Dec 8, 2023
@pplonski
Copy link
Contributor

pplonski commented Dec 8, 2023

Thank you @bardamchop for reporting the issue. Looks like a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants