{% extends "layout.html" %} {% block content %}

Polynomial Regression Visualizer

What is Polynomial Regression?

Polynomial Regression is a type of regression analysis that models the relationship between the independent variable x and the dependent variable y as an n-th degree polynomial. It extends simple linear regression by considering higher-degree terms.

Why Polynomial Regression?

General Equation:

y = θ0 + θ1x + θ2x2 + θ3x3 + ... + θnxn

Here, theta_0, theta_1, ..., theta_n are the coefficients learned by the model.

Theoretical Examples: y = x^2 + 2x

To illustrate how the equation y = x^2 + 2x creates a curve, let's substitute a few values for x:

  • When x = 0: y = (0)^2 + 2(0) = 0 + 0 = **0**

    An input of 0 results in an output of 0.

  • When x = 1: y = (1)^2 + 2(1) = 1 + 2 = **3**

    An input of 1 yields an output of 3.

  • When x = 3: y = (3)^2 + 2(3) = 9 + 6 = **15**

    With an input of 3, the output becomes 15.

  • When x = 5: y = (5)^2 + 2(5) = 25 + 10 = **35**

    For an input of 5, the predicted output is 35.

These examples show how the relationship between x and y is curved, not linear.

How this App Works:

Polynomial Curve Visualization

Model Details:

Equation: y = x^2 + 2x

Our model learned coefficients for:

  • x^0 (Intercept): 0.00
  • x^1: 2.00
  • x^2: 1.00

(These coefficients correspond to the formula y = θ₀ + θ₁x + θ₂x²)

Make a Prediction

{% if prediction is not none %}

Predicted Value (y):

{{ prediction }}

{% endif %}
{% endblock %}