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

Invalid comparison between dtype=timedelta64[ns] and float64 #650

Open
adrienpacifico opened this issue Sep 12, 2023 · 1 comment
Open

Comments

@adrienpacifico
Copy link
Contributor

Traceback (most recent call last):
File "/opt/conda/lib/python3.11/site-packages/pandas/core/arrays/datetimelike.py", line 935, in _cmp_method
other = self._validate_comparison_value(other)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/arrays/datetimelike.py", line 571, in _validate_comparison_value
raise InvalidComparison(other)
pandas.errors.InvalidComparison: 3.4028234663852886e+38

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/conda/lib/python3.11/site-packages/supervised/base_automl.py", line 1195, in _fit
trained = self.train_model(params)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/supervised/base_automl.py", line 401, in train_model
mf.train(results_path, model_subpath)
File "/opt/conda/lib/python3.11/site-packages/supervised/model_framework.py", line 197, in train
].fit_and_transform(
^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/supervised/preprocessing/preprocessing.py", line 298, in fit_and_transform
X_train[numeric_cols] = X_train[numeric_cols].clip(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/frame.py", line 11457, in clip
return super().clip(lower, upper, axis=axis, inplace=inplace, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/generic.py", line 8215, in clip
return self._clip_with_scalar(lower, upper, inplace=inplace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/generic.py", line 8024, in _clip_with_scalar
subset = self <= upper
^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/ops/common.py", line 81, in new_method
return method(self, other)
^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/arraylike.py", line 52, in le
return self._cmp_method(other, operator.le)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/frame.py", line 7445, in _cmp_method
new_data = self._dispatch_frame_op(other, op, axis=axis)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/frame.py", line 7484, in _dispatch_frame_op
bm = self._mgr.apply(array_op, right=right)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/internals/managers.py", line 350, in apply
applied = b.apply(f, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/internals/blocks.py", line 329, in apply
result = func(self.values, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/ops/array_ops.py", line 279, in comparison_op
res_values = op(lvalues, rvalues)
^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/ops/common.py", line 81, in new_method
return method(self, other)
^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/arraylike.py", line 52, in le
return self._cmp_method(other, operator.le)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/arrays/datetimelike.py", line 937, in _cmp_method
return invalid_comparison(self, other, op)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/pandas/core/ops/invalid.py", line 36, in invalid_comparison
raise TypeError(f"Invalid comparison between dtype={left.dtype} and {typ}")
TypeError: Invalid comparison between dtype=timedelta64[ns] and float64

Please set a GitHub issue with above error message at: https://github.com/mljar/mljar-supervised/issues/new

@adrienpacifico
Copy link
Contributor Author

Related to: #122

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant