<jupyter_start><jupyter_text>Solutions  1. Load the data<jupyter_code>bmi_life_data = pd.read_csv('bmi_and_life_expectancy.csv')<jupyter_output><empty_output><jupyter_text>2.Build a linear regression model<jupyter_code>def linear_regression(x, y):
    m=1
    b=0
    for epoch in range(epochs):
        for i in range(len(x)):
            pred = m*x[i] + b
            diff = y[i] - pred
            m += m*diff*learning_rate
            b += diff*learning_rate
    return m, b<jupyter_output><empty_output><jupyter_text>3. Predict using the model<jupyter_code>def predict(m, b, bmi):
    return m[0]*bmi + b[0]

m, b = linear_regression(x, y)
predict(m, b, 21.07931)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12607449856733524, 'fraction_numerical': 0.02005730659025788, 'mean_word_length': 3.787671232876712, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '117377', 'license': 'MIT', 'n_tokens_mistral': 283, 'n_tokens_neox': 275, 'n_words': 52, 'path': 'linear-regression/RegressionSolutions.ipynb', 'repo_name': 'pahadeyash/udacity-deep-learning', 'size': '698'}