Question: Problem 1. Design/develop a function named train.m for the training process that will obtain a , b 1 , and b 2 . The function
Problem
1. Design/develop a function named train.m for the training process that will obtain a , b 1 , and b 2 . The function need read the file customerdata.xlsx for x 1 , x 2 and y . Your script should prompt the user for the percentage of customers who are used for th e training.
You cannot assume the total numbers of the customers in the file. Display a , b 1 , and b 2 at end of the function.
2. Design/d evelop a program named predict.m for the estimating/predicting process.
a) The program should call the function developed in item 1 to get a , b 1 , and b 2 . Then calculate and display y for all customers.
b) Use y estimate for the shoulder length that is obtained in the estimating process , and y real for the shoulder length in the file customerdata.xlsx. Calculate and display the accuracy rate for all the customers.
c) Calculate and display average accuracy rates for the untrained customers and trained customers respectively.
d) Plot y real and y estimate on the same graph just like Figure 1 . On the xlabel, you cannot assume the total number of the customers ( which is 153 here ) . That means you should create a customized total number of the customers for xlabel. Use red * to indicate the total number of the customers used for training on the graph .
e) Write your all results in a file named results.xlsx in the format:
Pic No.
accuracy rate
1 272.00 274.56 99.06 %
2 295.00 284.40 96.41 %
3 269.00 260.05 96.67 %
f) When you run your program, the output should look like this
>> predict
Enter the percentage ? 90
138 pictures data are used in training process
b1= 0.78 b2=150.32 and a=0.03
Pic No.
accuracy rate
1 272.00 274.56 99.06 %
2 295.00 284.40 96.41 %
3 269.00 260.05 96.67 %
4 304.00 286.32 94.18 %
5 308.00 284.56 92.39 %
152 265.00 278.42 94.94 %
153 263.00 277.64 94.43 %
The average accuracy rat e for trained pictures is 95.33
The average accuracy rate for un - trained pictures is 97.29
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
