Linear regression with least square method

Beijing Institute of Technology | Ming-Jian Li

The following Python code is a companion code for the course on Artificial Intelligence and Simulation Science. It functions to fit a line using linear regression based on a given dataset and make predictions, with parameter optimization using the least square method.

The fitting results are as follows.