Skip to content
New issue

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

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

Already on GitHub? # to your account

Cannot predict with numpy inputs #1262

Open
leelew opened this issue Dec 12, 2023 · 1 comment
Open

Cannot predict with numpy inputs #1262

leelew opened this issue Dec 12, 2023 · 1 comment
Labels
question Further information is requested

Comments

@leelew
Copy link

leelew commented Dec 12, 2023

Hi,

I trained AutoML model for regression task. But when I use model.predict(), it returns TypeError. So how can I fix this problem?

Best,
Li


Traceback (most recent call last):
File "", line 1, in
File "/home/lilu/anaconda3/envs/am/lib/python3.10/site-packages/flaml/automl/automl.py", line 573, in predict
X = self._state.task.preprocess(X, self._transformer)
File "/home/lilu/anaconda3/envs/am/lib/python3.10/site-packages/flaml/automl/task/generic_task.py", line 637, in preprocess
X = transformer.transform(X)
File "/home/lilu/anaconda3/envs/am/lib/python3.10/site-packages/flaml/automl/data.py", line 394, in transform
elif isinstance(X, DataFrame):
TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union

@Programmer-RD-AI
Copy link
Contributor

try:
import pandas as pd
from pandas import DataFrame, Series
except ImportError:
DataFrame = Series = pd = None

Could you check if you have installed pandas?
That may be the cause of the error...

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants