Multivariable Regression: Predicting Wine Taste

Building and Testing a Model to Predict Wine Taste

CODE

  • Listing 5-1: Using Cross-Validation to Estimate Out-of-Sample Error with Lasso Modeling Wine Taste—wineLassoCV.py
    • Figure 5-1: ... un-normalized Y
    • Figure 5-2: ... normalized Y
    • Figure 5-3: ... un-normalized X and Y

Training on the Whole Data Set before Deployment

CODE

  • Listing 5-2: Lasso Training on Full Data Set—wineLassoCoefCurves.py
    • Figure 5-4: Coefficient curves for Lasso trained to predict wine quality
    • Figure 5-5: Coefficient curves for Lasso trained on un-normalized Xs

Basis Expansion: Improving Performance by Creating New Variables from Old Ones

CODE

  • Listing 5-3: Using Out-of-Sample Error to Evaluate New Attributes for Predicting Wine Quality—wineExpandedLassoCV.py
    • Figure 5-6: Cross-validation error curves for Lasso trained on wine quality data with expanded feature set