Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2008 Comprehensive Concepts And Techniques

Authors: Gary B. Shelly, Corinne Hoisington

1st Edition

1423927168, 978-1423927167

More Books

Students also viewed these Databases questions

Question

1. Television more Over watching faceing of many problems ?

Answered: 1 week ago

Question

Is there a link between chronic stress and memory function?

Answered: 1 week ago