Linear Regression with PHP
Multiple Linear Regression with PHP-ML
Involves two or more independent variables. For example, predicting house prices based on factors like size, number of rooms, and location. This involves more than one independent variable and one dependent variable. The equation for multiple linear regression is: $y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \dots + \beta_n x_n$
Dataset
Test Data
rooms,size,distance,price
1,500,8,157250
2,750,9,198500
2,700,7,207825
2,850,6,251175
2,900,5,276250
3,1150,6,327250
3,1200,4,374850
3,1350,5,368750
3,1250,5,382500
3,1300,3,425000
4,1500,4,442750
4,1600,3,493000
4,1650,2,531250
4,1700,3,535500
4,1800,3,545000
5,1900,2,612000
5,2000,1,657750
5,2050,2,663000
5,2150,2,678250
5,2100,1,701500
6,2300,2,742750
6,2400,1,786250
6,2450,2,807500
6,2500,1,850000
6,2550,1,862500
rooms,size,distance
4,1800,3, // First house
2,1200,8 // Second house
Chart:
Features:
Result:
Memory: 0.112 Mb
Time running: 0.004 sec.
Predictions for new houses:
--------------------------
House 1: $577,026.62
House 2: $351,276.24
Metrics:
-------
Mean Squared Error: $10,608,032,372.39
Root Mean Squared Error: $102,995.30
Mean Absolute Error: $99,151.43