Do we have to remove target variable from data in Scikit-learn's linearmodel.fit()?
The X should not contain the target as one of the columns. If you include it your linear model will produce no coding errors, but to predict the target y it will just use the feature y.
Scikit-learn's documentation says there are two arguments to the function: X(data) and y(Target Values). Do we remove the target variable from our data and provide it separately as y? Or do we keep target variable in X and also provide it separately as y? I have come across both approaches and was wondering which was correct.