Answered step by step
Verified Expert Solution
Question
1 Approved Answer
As a student who has recently taken CS 3 5 7 , Paul is eager to put his knowledge learned in the class to use
As a student who has recently taken CS Paul is eager to put his knowledge learned in the class to use in realworld applications. He notices the weather forcast in ChampaignUrbana area is not very accurate and is determined to make it better.
After a summer of hard work, he has finished implementing his new software for predicting wind speed. Eager to test how well his software performs, he uses it to predict the wind speed for the next
days and then collects the actual wind data during these
days. He stores both his predicted data and the actual data in NumPy arrays.
To understand how well Paul's software performs, write a program to compute the maximum relative error of his prediction across these
days. HINT: Consider using numpy.ndarray.max to compute the maximum value element in an array.
The setup code gives the following variables:
Name Type Description
n int The number of days
predicted numpy.ndarray Array of length
representing the predicted wind speed for these
days
actual numpy.ndarray Array of length
representing the actual wind speed for these
days
Your code snippet should define the following variables:
Name Type Description
maxrelerror float The maximum relative error of Paul's prediction across these
days
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started