text_plain_output_1.png
from sklearn.linear_model import LinearRegression

import matplotlib.pyplot as plt

import os

import pandas as pd

data = pd.read_csv('/kaggle/input/heightvsweight-for-linear-polynomial-regression/HeightVsWeight.csv')

x = data.iloc[:, :-1].values
y = data.iloc[:, -1].values

from sklearn.linear_model import LinearRegression
lin_reg = LinearRegression()
lin_reg.fit(x, y)

plt.scatter(x, y, color='red')
plt.plot(x, lin_reg.predict(x), color='blue')
plt.xlabel('Age')
plt.ylabel('Height')
plt.title('Linear Regression for Height and Weight')