CSc 430 - Software Engineering/Advanced GUI
Programming
Lab #4 - Prof.
Domanski
Download Sample Data for this lab
click on the image
below to try it out
Objective To create a
generic line graph with the following required properties:
- read data from a file that a user chooses (e.g. 430DATA.csv)
- allow the user to choose the
starting and ending values of the X axis
- allow the user to choose 1 (or
more) Y values to graph
- graph the (X,Y) coordinates
selected, and appropriately scale the X and Y axes
- compute the linear
regression equation for each set of Y's
- graph the linear regression
line on the same graph and display R2 for each
Y selected
- allow users to highlight a new
starting and ending X value from the displayed graph by using their
mouse
- redisplay all graphs using the
new interval (a zoom function)
The BASIC file structure
|
date
|
mm/dd/yy |
X |
|
#transactions
|
int |
X |
|
cpu % busy
|
int |
Y |
|
response time
|
int |
Y |
|
disk % busy
|
int |
Y |
|
net % busy
|
int |
Y |
Regression Basics Straight
Line formula ® Y = M*X + B
Regression: given a set of
(x,y)s, compute approximate values of M and B, so that if
given a new value of X, we could estimate what the corresponding Y
value would be.
Formulas: where x' and y'
are the average values for x and y respectively, and n is the
number of points you have --
- Ssx = å
x2 - n ( x' )2 Ssx
= Sum of Squares of X
- Ssy = å
y2 - n ( y' )2 Ssy
= Sum of Squares of Y
- Sxy = å
x y -
n x' y' Sxy = Sum of x*y pairs
- M = Sxy / Ssx
M = Slope of line
- B = y' - M * x'
B = Y-Intercept
- Sse = å y2 - Bå y - M å x y Sse = Sum of Squares of
errors
- R2
= (Ssy - Sse ) / Ssy
R2
is a "goodness of fit " estimator: 1 is a great fit, 0 is terrible)
Important Stuff:
- Working code is due
late April
(3½ weeks after initial posting)
- Documentation/Help must be included in the
working code
- Test Plan notes must be included in the
documentation
Last edited by DrB
on Wednesday, February 18, 2009