How to calculate Linear Regression from the given data

Viewed 16

Use the reading, writing, math, and science scores to predict a student's score in social studies. Train your model using LinearRegression in sklearn. Add the model's predictions to the data as a new column called socst_pred_skl

hsb2 = pd.read_csv('C:/Users/bjkha/OneDrive/Desktop/Assignments/520-Second-Class/data/hsb2.csv')
X = hsb2[['read', 'write', 'math', 'science']] Y = hsb2['socst']
X.head()
read    write   math    science
0   57  52  41  47
1   68  59  53  63
2   44  33  54  58
3   63  44  47  53
4   47  52  57  53
0 Answers
Related