Using pretrained model with sample features

12 views Asked by At

I am new to machine learning, and I have trained a linear regression model. I have loaded the pretrained model, but I don`t know how to put my features into the model and get the prediction.

I have tried this code and I expected 1 prediction with these 10 features, all this 10 features are what the model needs: x = [2.0 , 2.4, 1.5, 3.5, 3.5, 3.5, 3.5, 3.7, 3.7] linear.fit(x, y) predict_x = linear.predict(x) print(f'Predict = {predict_x}') But I got this error:

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.

0

There are 0 answers