A clinic can only afford some of the ten diabetes measurements. For a given set of columns, they want to know whether a curved model earns its extra columns.
Write straight_or_curved(columns).
load_diabetes(return_X_y=True, as_frame=True) and split it with train_test_split(X, y, test_size=0.25, random_state=0).columns.make_pipeline(StandardScaler(), LinearRegression()).make_pipeline(PolynomialFeatures(2), StandardScaler(), LinearRegression()).Return a dict:
"straight": the straight model's test R², rounded to 3 places."curved": the curved model's test R², rounded to 3 places."ship": "curved" if the curved model's unrounded test R² is higher, otherwise "straight".