<jupyter_start><jupyter_text>narrative here prototype plotting<jupyter_code>def makeAbear(xvalues,yvalues,xleft,yleft,xright,yright,xlab,ylab,title):
# plotting function dependent on matplotlib installed above 
# xvalues, yvalues == data pairs to scatterplot; FLOAT
# xleft,yleft == left endpoint line to draw; FLOAT
# xright,yright == right endpoint line to draw; FLOAT
# xlab,ylab == axis labels, STRINGS!!
# title == Plot title, STRING
    plt.scatter(xvalues,yvalues)
    plt.plot([xleft, xright], [yleft, yright], 'k--', lw=2)
    plt.xlabel(xlab)
    plt.ylabel(ylab)
    plt.title(title)
    plt.show()
#    return()<jupyter_output><empty_output><jupyter_text>narrative heresimple example<jupyter_code>sample_length = [101.3,103.7,98.6,99.9,97.2,100.1]
sample_weight = [609,626,586,594,579,605]
#
makeAbear(sample_weight, sample_length,580,96,630,106,'xaxis','yaxis','title')<jupyter_output><empty_output><jupyter_text>narrative hereexplain the loop structure<jupyter_code>sumx = 0.0
sumy = 0.0
sumxy = 0.0
sumx2 = 0.0
sumy2 = 0.0
for i in range(len(sample_weight)):
    sumx = sumx + sample_weight[i]
    sumx2 = sumx2 + sample_weight[i]**2
    sumy = sumy + sample_length[i]
    sumy2 = sumy2 + sample_length[i]**2
    sumxy = sumxy + sample_weight[i]*sample_length[i]
b1 = (sumx*sumy - len(sample_weight)*sumxy)/(sumx**2-len(sample_weight)*sumx2)
b0 = sumy/len(sample_length) - b1* (sumx/len(sample_weight))
lineout = ("Linear Model is y=%.3f" % b1) + ("x + %.3f" % b0)
print("Linear Model is y=%.3f" % b1 ,"x + %.3f" % b0)<jupyter_output>Linear Model is y=0.129 x + 22.813<jupyter_text>narrative hereset up explain output plotlineout<jupyter_code>xleft = min(sample_weight)
yleft = b1*xleft +b0
xright = max(sample_weight)
yright = b1*xright +b0
makeAbear(sample_weight, sample_length,xleft,yleft,xright,yright,'Sample Weight (g)','Sample Length (mm)',lineout)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14834297738032615, 'fraction_numerical': 0.04997369805365597, 'mean_word_length': 6.123595505617978, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '216729', 'license': 'CC0-1.0', 'n_tokens_mistral': 812, 'n_tokens_neox': 766, 'n_words': 141, 'path': '1-Lessons/Lesson19/PsuedoLesson/.ipynb_checkpoints/LinearRegressionNormalEquations-checkpoint.ipynb', 'repo_name': 'dustykat/engr-1330-psuedo-course', 'size': '1901'}