Home » ML
      Bookmark ·  Report ·  More actions.. Lock comments ·  Pin thread

Your first Machine Learning project in Python with Step-By-Step instructions (Part 4 of 6)

404

nVector

posted on 04 Sep 18

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds




Faridun05-Apr-19

Hi! Why when i test my model whith code print(model.predict(6.3)) i get error: ValueError: Expected 2D array, got scalar array instead: array=6.3. 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.

Jyotir20-Dec-19

Pls. add [] to the value being considered for prediction of salary.

Ex.

print(model.predict([[6.3]]))

Thanks.