I know this has been asked before a few times (here, here, here, and here) but I can’t find a solution that works for me. I have a tabular dataset containing both continuous and categorical variables. I now have a trained model as a pkl file and would like to make predictions on a new test set (in the form of a dataframe).
According to the docs, there are two ways to make predictions: on a single row and on an entire dataframe. I am able to make predictions on a single row - learn.predict(df.iloc[0])
, but when I try to make on the entire test set (as shown in the docs):
dl = learn.dls.test_dl(test_df)
learn.get_preds(dl=dl)
I get:
AttributeError: 'Learner' object has no attribute 'dls'
I would really appreciate if someone can help me with that and write the correct syntax to make predictions on a test set for regression problem using fastai v1 tabular API.