FLAML icon indicating copy to clipboard operation
FLAML copied to clipboard

Cannot predict with numpy inputs

Open leelew opened this issue 1 year ago • 1 comments
trafficstars

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

leelew avatar Dec 12 '23 07:12 leelew

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...

Programmer-RD-AI avatar May 22 '24 08:05 Programmer-RD-AI