I used the lines of code below to fit a model in sklearn.
linearmodel =LinearRegression()
linearmodel.fit(x_train, y_train)
but I get this error: ValueError: could not convert string to float: 'Male'
what could be wrong?
Your y_train
contains Strings, they should be numbers associated to a class.
Eg : 0 for Male, 1 for Female etc
After you get the prediction out after training, you have to display the class label associated to the number.