la funcion definida en el ejercicio 4 y 5 deben ser usadas en este problema las puedes
Fantastic news! We've Found the answer you've been seeking!
Question:
la funcion definida en el ejercicio 4 y 5 deben ser usadas en este problema las puedes definir con el nombre que quieras y yo las sustituyo
Transcribed Image Text:
6. (2 points) Create a function called best model that takes as argument a list called x that contains numbers, a list called y that also contains numbers, and a list called all models that contains lists. Each list in all models contains two numbers that represent a [m,b] combination. Each [m,b] combination represents a set of parameters that define a different linear model. For example, if all models-[[4.4,5]. [1.5,3]], then each list represents a set of parameters that define the linear models: 462 123 Model 1:9 Model 2: 9, 4.4 xx, +5 1.5 xx, +3 The function best medel must compute the predictions (9) and the SSE of each model based on the model parameters and the values in the x and y lists. Finally, the function must return the model parameters that result in the minimum SSE (i.c., the best model). Note that you can use the functions defined in Problems 4 and 5 within best_model. 124 125 126 #--- 127 # Solution to Exercise # 6 #START CODE HERE 128 129 130 #END CODE HERE 131 132 133 134 135 136 137 138 ### TEST CASE FOR EX 6 ### Run the following lines. # If you get "Correct" you # did it right. x = [1,3,5] y = [2.5, 6.5, 10.5] all models [[3,-1], [2,0.25], [2.5, 0.1]] result[] use your function here; delete the empty list if result = [2, 0.25]: 139 140 141 142 143 14 print("Correct!") 145 else: 146 print("Incorrect :(") 147 148 149 150 6. (2 points) Create a function called best model that takes as argument a list called x that contains numbers, a list called y that also contains numbers, and a list called all models that contains lists. Each list in all models contains two numbers that represent a [m,b] combination. Each [m,b] combination represents a set of parameters that define a different linear model. For example, if all models-[[4.4,5]. [1.5,3]], then each list represents a set of parameters that define the linear models: 462 123 Model 1:9 Model 2: 9, 4.4 xx, +5 1.5 xx, +3 The function best medel must compute the predictions (9) and the SSE of each model based on the model parameters and the values in the x and y lists. Finally, the function must return the model parameters that result in the minimum SSE (i.c., the best model). Note that you can use the functions defined in Problems 4 and 5 within best_model. 124 125 126 #--- 127 # Solution to Exercise # 6 #START CODE HERE 128 129 130 #END CODE HERE 131 132 133 134 135 136 137 138 ### TEST CASE FOR EX 6 ### Run the following lines. # If you get "Correct" you # did it right. x = [1,3,5] y = [2.5, 6.5, 10.5] all models [[3,-1], [2,0.25], [2.5, 0.1]] result[] use your function here; delete the empty list if result = [2, 0.25]: 139 140 141 142 143 14 print("Correct!") 145 else: 146 print("Incorrect :(") 147 148 149 150
Expert Answer:
Related Book For
Business research methods
ISBN: 978-1439080672
8th Edition
Authors: William G Zikmund, Barry J. Babin, Jon C. Carr, Mitch Griff
Posted Date:
Students also viewed these programming questions
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
Given that a quantity Q(t) is described by the exponential growth function Q(t) = 400e0.01t where t is measured in minutes, answer the following questions. (a) What is the growth constant k? k = (b)...
-
How would you describe Benton's culture? Discuss.
-
For an SKU, the standard deviation of demand during the lead time is 150 units, the annual demand is 10,000 units, and the order quantity is 750 units. Management says it will tolerate only one...
-
Several professionals are listed as being part of compliance efforts with regard to participation in the examination of potential compliance violations. Identify at least three other categories of...
-
For the year ended December 31, 2014, Denkinger Electrical Repair Company reports the following summary payroll data. Gross earnings: Administrative salaries ............$200,000 Electricians wages...
-
Connect each yearly salary to the correct paycheck payment. A. $55,000 B. $60,000 C. $26,000 D. $129,000 E. $56,000 OS $500 weekly $5,000 monthly $2,333 semi-monthly $4,961 biweekly $4,583 monthly
-
A company is considering buying a machine that would give a net cost savings of 60,000 per year for 10 years. The cost of the machine is $325,000. The company's weighted average cost of capital is...
-
Write the calculation process and results. Your answers should be in full sentences and 1-3 paragraphs each. 1. Assume the manager of ABC Corp makes the following statement: "To lower my cost of...
-
1. Take a string from the user and print it in the reverse order using stack data structure. Also prints the unicode of each character Input: WATERMELON Output: NOLEMRETAW Hint: Use the property of...
-
Maboneng Mokeng ("Mami'') acquired three adjoining (adjacent) fruit farms (R550 000 each) in Limpopo on 1 May 1997 when she was 39 years old. She has farmed on these farming lands since then. Mami is...
-
Prior to beginning this assignment, read all the chapters of the book Organizational behavior. analyze the organizational behavior of your current or former employer and submit your analysis as a...
-
Bob & Kate are purchasing a new home. The house they've selected has a price of $350,000. The mortgage interest rate is currently 5% (regardless of the option they pick below). They are considering...
-
1. (40 points) a) (28 points) In a little over 5 billion years, our star will slough off~20% of its mass and collapse to a white dwarf star of radius 8,000 km. We will model it as a sphere. What will...
-
Compare and contrast debt financing and equity financing as ways of starting a new business. Does one have an overall advantage over the other? What situation is more favorable to the use of debt...
-
What problems do research directors face in their roles as managers?
-
In a survey, chief executive officers (CEOs) indicated that they would prefer to relocate their businesses to Atlanta (first choice), San Diego, Tampa, Los Angeles, or Boston. The CEOs who said they...
-
In what ways might the design in question 2 yield systematic or nonsampling error?
-
______________ occur(s) when the speaker should pause but instead fills the silence (umm, ahh).
-
Identify an election (federal, state, or local) for which a debate was broadcast. Analyze how the different speakers were able to adapt their messages based on the moderators questions and their...
-
___________ refers to your credibility as a presenter as well as the credibility of the information delivered in your presentation.
Study smarter with the SolutionInn App