Question: TASK 1 : Linear Regression ( 1 5 % - 1 0 0 marks ) This task will test your knowledge of file input and

TASK 1: Linear Regression (15%-100 marks)
This task will test your knowledge of file input and mathematical formulas. Basic linear regression
(LR) is used to find a relationship between two types of data. For example, you could use LR to find
the relationship between glucose intake and heart rate. These initially would be plotted on a graph
where the x axis represents glucose and the y axis represents heart rate. Using the LR formula, you
can find y=bx+a(equation of a straight line (more commonly known as y=mx+c) between "n"
number of points on a graph. Below are the formulas to find "a" and "b."
A=(y)(x2)-(x)(xy)n(x2)-(x)2
B=n(xy)-(x)(y)n(x2)-(x)2
You will be given multiple text files containing "n" number of coordinates. Your program will read in
the coordinates (x,y) and use the LR formula to produce the gradient (a) and the constant (b), and
being able to print out y=bx+a. For example, if a=0.5 and b=-2, your program will print out
y=-2x+0.5. This equation now represents the trend in the data you will be given. Finally, your
program will ask the user to type in a value of x which will then calculate y.
Read data from file appropriately (30 marks)
Use LR formula to process the data and print out the correct equation of a straight line (50
marks) Find new value of "y" using user input (20 marks) in c programming
 TASK 1: Linear Regression (15%-100 marks) This task will test your

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!