Please write a program that can do regularized linear model regression (polynomial basis) and visualization.
You should do it by both LSE and Newtons method.
Input parameters:
- the path and name of a file which consists of data points (comma seperated: x,y):
Program Behavior: For example, if the number of bases is set to 3, it means that the program is going to find a curve that best fits the data points by Required functions:
- For LSE:
- Use LU decomposition to find the inverse of , Gauss-Jordan elimination wont be accepted.(A is the design matrix).
- Print out the equation of the best fitting line and the error.
- For Newtons method:
- Please use the method mentioned in the lesson.
- Print out the equation of the best fitting line and the error, and compare to LSE. For visualization:
- Please visualize the data points which are the input of program, and the best fitting curve.
- Its free to use any existing package. NOTE:
Use whatever programming language you prefer.
You should use as few functions from any library as possible. That would be great if you implement all detail operations (like matrix operations) by yourself.
Time complexity is not what we care for now, but if you like to improve it in that regard,
it is always good for you.
Grading policy
You must implement matrix inverse operation by yourself. Please do not use the built in
Reviews
There are no reviews yet.