0

I try to use Pycaret to find the best model for my problems. I have 10 variable to predict, so I do a loop (for) to setup and find best model for all each variable.

best_model = []
for predict in Y:
    tmp_df = df[X].copy()
    test_df = pd.concat([tmp_df, df[predict]], axis=1)
    test_df = test_df[test_df[predict] != 9]
    setup(data=test_df, target=predict, html=False, verbose=False)

The error is : ValueError: X does not contain the columns listed in cols

But this error never occurs in the same place. Sometimes at the first loop, sometimes further in the loop.

Someone can help me ? I don't understand why this error is never in the same place

Tony
  • 33
  • 4

0 Answers0