# Quadratic Turning Points
# Module 6 - Quadratic Terms and Turning Points
# Dataset: M6_HOUSING_LOGS

# Quadratic Turning Points
#
# Module 6 notebook lab. This notebook uses a synthetic Ceteris Lab teaching dataset and does not report real empirical findings.

# Learning goal
# Practice the Module 6 concept with editable Python code. Interpret units, functional form, controls, prediction, and uncertainty carefully.

# %% Cell 3
import pandas as pd
import statsmodels.api as sm

df = pd.read_csv('/data/module-6/M6_HOUSING_LOGS.csv')
print(df.head())
print(df.describe().round(2))

# Edit the columns below to match the lesson question before interpreting output.
y = df['price']
X = df.select_dtypes('number').drop(columns=['price']).iloc[:, :3]
model = sm.OLS(y, sm.add_constant(X)).fit()
print(model.summary())

# Reflection
# Write two sentences: one coefficient or prediction interpretation, and one limitation that prevents overclaiming.
