首页 > > 详细

解析R编程、R编程解析、辅导留学生R设计、R设计辅导留学生、讲解留学生R语言

This homework assignment aims to implement an iterative algorithm for predicting
unit prices of meal items. Sample codes are provided and you are required to
complete missing lines, evaluate your codes and report your observations. Details
instructions are as follows.

Overview. In this exercise, you are allowed to order a meal of fish, chip and
ketchup at a cafeteria, with different portions each. The cashier will provide the
total price of the meal you ordered. After ordering several meals, you should be
able to figure out the unit price of each portion of fish, chip or ketchup using an
iterative method.


Sample codes. The file “main_part.m” is used to simulate the interactions between
a customer and a cashier. It starts with a random guess of the unit prices. At each
iteration, with ground-truth unit prices, we first randomly generate a three-element
array, representing the portions of fish, chip and ketchup in a meal. Then, the meal
is priced based on the ground-truth unit prices. Last, we need to update the unit
prices using the method we taught in the class. Once done, the starter codes will
compare the optimal prediction with the ground-truth, and calculate the average
error as a quantitative result.

You will need to fill in the missed code lines to complete the iterative prediction.
Replace the PLACEHOLDER lines with your code.

This script. includes two PLACEHOLDERS.

For the first PLACEHOLDER, you need to set the three parameters, i.e., initial
predictions, learning rate, and stop conditions.

For the second PLACEHOLDER, you need to calculate the current error, i.e. the
difference between the estimated price and true price. You also need to adjust the
estimation of unit prices based on the current error.

Upon completing the script, please try to run through the script. with different
values for the three parameters (i.e., initial predictions, learning rate, stop
conditions) in PLACEHOLDER_1. Please observe how these changes affect the
quantitative results of your script, i.e. prediction errors. Please explore at least 3
configurations of these parameters and report your best results.


Write-up
In the report you will describe your algorithm and any decisions you made to
write your algorithm a particular way. Then you will show and discuss the
results of your codes following the above instructions. In the case of this project,
show the convergence curves and quantitative results for each case of your
implementations. Also, discuss anything extra you did. Feel free to add any other
information you feel is relevant.
How to submit
● The codes should be self-contained, and run without any error. Otherwise,
severe penalty will be applied.
● Two re-submissions are allowed.
● No hard copy required.


 

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!