0

I run the code below and it produces the ValueError above and I can't figure out why.

I have a different virtual environment where it works just fine where the only difference is I installed PyCaret with "pip install pycaret" instead. I used the --pre PyCaret installation instead because the setup() function has the fh (forecast horizon) parameter in that installation.

Installed packages

pip install --pre pycaret
pip install openpyxl
install jupyter

python version 3.8.13

Code

from pycaret.regression import *
from pycaret.datasets import get_data
from pycaret.time_series import *
import pandas as pd
import numpy as np

xls = pd.ExcelFile('El-data.xlsx')
el_tavle = pd.read_excel(xls, 'El-tavle')

el_tavle.set_index('Fra_dato', drop = True,  inplace = True)

el_tavle['Maengde'].plot()

el_tavle['Maengde'].plot(kind = 'box')

el_tavle_setup = setup(el_tavle, 'Maengde', fh = 90, session_id = 123)

I expected the the setup() function to run without problems. Instead it produced an error.

  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Nov 12 '22 at 20:52

1 Answers1

0

In your setup call you specified both data and data_func

el_tavle_setup = setup(el_tavle, 'Maengde', fh = 90, session_id = 123)

equals to

el_tavle_setup = setup(data=el_tavle, data_func='Maengde', fh = 90, session_id = 123)

and what you wanted to write is:

el_tavle_setup = setup(data=el_tavle, target='Maengde', fh = 90, session_id = 123)

Be careful when passing unnamed arguments.

MarcinKamil
  • 135
  • 8