<jupyter_start><jupyter_text>LINEAR REGRESSION<jupyter_code>#dependent & independent variable

# y hat = b0 + b1x1

y = data['GPA']
x = data['SAT']
#Visual representation

plt.scatter(x,y)
plt.xlabel('SAT', fontsize = 20)
plt.ylabel('GPA', fontsize=20)
plt.show()
x1 = sm.add_constant(x)
result = sm.OLS(y,x1).fit()
result.summary()
# y^ = b0 + b1x1


#b0 = .275
#b1 = .0017

# y^ = .275 + .0017x1

# GPA = .275 + .0017 * SAT SCORE

# Example Student has a 1800 SAT score going into college, by our model ..

SAT_SCORE = 1800
GPA = .275 + .0017  * SAT_SCORE
print(GPA)
# We can assume, by our model, that this student will have a 3.35 GPA at graduation!<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1478770131771596, 'fraction_numerical': 0.07906295754026355, 'mean_word_length': 4.104477611940299, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '112249', 'license': 'Unlicense', 'n_tokens_mistral': 325, 'n_tokens_neox': 282, 'n_words': 77, 'path': 'images/Linear Regression to forecast GPA of a student based on SAT scores (statsmodel).ipynb', 'repo_name': 'dsk0203/dsk0203.github.io', 'size': '683'}