text_plain_output_1.png image_output_1.png
from sklearn.linear_model import LinearRegression

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.preprocessing import PolynomialFeatures
poly_reg = PolynomialFeatures(degree=3)
x_poly = poly_reg.fit_transform(x)
lin_reg2 = LinearRegression()
lin_reg2.fit(x_poly, y)