Icon

Training error vs Degree (Complexity)

<p>This workflow is designed to illustrate how traininig error diminishes with model complexity.</p><p>The workflow reads in the dataset and tries to find the <strong>polynomial regression model</strong> with the minimum training error. We check various degrees (from 1 to 10) using the "Parameter Optimization Loop". For each degree, we compute the training error.<br><br>We plot the training error vs the degree. We also identify the degree that minimizes the training error and we use all the data to train a polynomial of that degree.</p>

This workflow is designed to illustrate how traininig error diminishes with model complexity.

The workflow reads in the dataset and tries to find the polynomial regression model with the minimum training error. We check various degrees (from 1 to 10) using the "Parameter Optimization Loop". For each degree, we compute the training error.

We plot the training error vs the degree. We also identify the degree that minimizes the training error and we use all the data to train a polynomial of that degree.

Finding the Polynomial Degree that minimizes training error

This section systematically tests different polynomial degrees to find which one best fits the data. For each degree, the workflow trains a polynomial regression model on the training data, predicts outcomes, and evaluates prediction error using the same data used to train the model (i.e. training error). After all degrees are tested, it summarizes the errors for each degree, helping you identify the model complexity that minimizes the training error. The results are visualized to show how error changes as the polynomial degree increases.

Visualize Final Regression Model and Coefficients

After selecting the polynomial degree that minimizes the training error, the workflow trains a final regression model with that degree. It then plots the regression line alongside the data points to visually show how well the model fits. Finally, it displays the model's coefficients and statistics in a table, helping you interpret the model's parameters and overall fit.

Regression Line Plotter
Parameter Optimization Loop End
Polynomial Regression Learner
Numeric Scorer
Table View
Scatter Plot
Table Row to Variable
Polynomial Regression Learner
Read data. Target generated withg[x_] := 200 + 1000 x - 80 x^2 + x^3;plus noise
CSV Reader
Regression Predictor
Column Renamer
Parameter Optimization Loop Start

Nodes

Extensions

Links