microsoft / FLAML

A fast library for AutoML and tuning. Join our Discord: https://discord.gg/Cppx2vSPVP.
https://microsoft.github.io/FLAML/
MIT License
3.75k stars 495 forks source link

Cannot predict with numpy inputs #1262

Open leelew opened 6 months ago

leelew commented 6 months ago

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 commented 1 month ago

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