Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Before we jump into implementing hill climbing all on our own, lets work through the first couple of steps. let's pretend your first guess as
Before we jump into implementing hill climbing all on our own, lets work through the first couple of steps. let's pretend your first guess as to the correct line for this data is f(x)=2x+17 meaning your guess is that the slope a is 2 and the intercept b is 1 . 1. What would the predicted outputs be given this function? i.e. plug in the x values from your data into the function to get the predicited y values 2. Store these predicitons in an array, and then calculate and print the error for this guess using mean squared error. Note: you should use the function from the sklearn package. 3. Given this starting line, there are 8 possible neighbors lines from this starting line: - m and b+1 - m and b1 - m+1 and b+1 - m+1 and b-1 - m+1 and b - m-1 and b+1 - m1 and b1 - m1 and b What is the error for each of these "neighbor lines? 4. Given starting point f(x)=2x+17. Which neighbor line should you chose as your next step? 5. Now from this line you chose in Question 4 , what are your neighbors? and what is the error for each of these neighbor lines? 6. Now repeat steo 5 once again (ce. chose one of the lines, find all the neighbors of that new line, and print the errors for each new line) x=( data [xx]) y=(2x)+17 data[Predict' ]=(2x)+17
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