0

I am trying to create an Linear Regression model in python . code is as follow

time_values = np.linspace(1,23,23) # print from 1,2...23
number_of_clients = [] # create empty list that will hold number of clients
for i in range(1,24,1):
    rand_vlaue = random.randint(1,20) # generate number of clients
    number_of_clients.append(rand_vlaue)

print time_values
print number_of_clients

model = LinearRegression()
model.fit(time_values,number_of_clients)
model.predict(24)

I am getting the following error while running

Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
Amarjit Dhillon
  • 2,718
  • 3
  • 23
  • 62

0 Answers0