A simple implementation of multivariate linear regression using gradient descent, built with NumPy and Matplotlib.
-
Feature Matrix Creation: Generates random feature vectors with multiple variables (
$x_1$ ,$x_2$ ) -
Target Generation: Creates synthetic data with linear relationship
$y = \theta_0 + \theta_1 x_1 + \theta_2 x_2 + noise$ - Cost Function: Calculates Mean Squared Error between predictions and true values
-
Gradient Descent: Iteratively finds optimal parameters
$\theta_0$ ,$\theta_1$ , and$\theta_2$ - 3D Visualization: Shows data points and fitted plane in 3D space
Shows the synthetic data points distributed in 3D space with two features (
Displays the cost reduction over iterations during gradient descent optimization.
Shows the original data points with the fitted regression plane in 3D.