Linear regression: Parameters exercise
Stay organized with collections Save and categorize content based on your preferences.
The graph below plots 20 examples from a fuel-efficiency dataset, with the feature (car heaviness in thousands of pounds) plotted on the x-axis and the label (miles per gallon) plotted on the y-axis.
Your task: Adjust the Weight and Bias sliders above the graph to find the linear model that minimizes MSE loss on the data.
Questions to consider:
- What is the lowest MSE you can achieve?
- What weight and bias values produced this loss?
Click the plus icon to see the solution
The optimal linear model for this data has an MSE of 3.37, with a weight of –0.12 and a bias of 16.96, as shown in the following image.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-25 UTC.
[null,null,["Last updated 2025-08-25 UTC."],[],[],null,["# Linear regression: Parameters exercise\n\nThe graph below plots 20 examples from a fuel-efficiency dataset, with the\nfeature (car heaviness in thousands of pounds) plotted on the x-axis and the\nlabel (miles per gallon) plotted on the y-axis.\n\n**Your task:** Adjust the **Weight** and **Bias** sliders above the graph to\nfind the linear model that minimizes MSE loss on the data.\n\n**Questions to consider:**\n\n- What is the lowest MSE you can achieve?\n- What weight and bias values produced this loss?\n\n#### Click the plus icon to see the solution\n\nThe optimal linear model for this data has an MSE of 3.37, with a\nweight of --0.12 and a bias of 16.96, as shown in the following image."]]