I'm trying to make predictions about the number of customers at a restaurant (=label) at a certain weekday (0-6) and a time, using them as features. My dataframe looks like this:
My sketch at making my model predict the number of customers at the first data point available, the first row, is this:
deg = 10 #the chosen polynomial degree
lin_regr = LinearRegression(fit_intercept=False) #linregr object
poly = PolynomialFeatures(degree=deg) #polynomial model
X_train_poly = poly.fit_transform(X_train) # fit the features
lin_regr.fit(X_train_poly, y_train)
print(lin_regr.predict([df.iloc[0]['weekday'], df.iloc[0]['acchour']]))
#The last line is causing the error
However, I'm getting
ValueError: Expected 2D array, got 1D array instead: array=[1. 6.75]
What is the reason behind this, and what is the proper syntax to feed the two features into the function predict()?
