Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Now that we have formatted our data, we can fit a model using sklearn's Ridge ( ) class. We'll write a function that will take
Now that we have formatted our data, we can fit a model using sklearn's Ridge class. We'll write a function that will take as input the features and response variables that we created in the last question, and returns a trained model.
Function Specifications:
Should take two numpy arrays as input in the form Xtrain, ytrain
Should return an sklearn Ridge model.
The returned model should be fitted to the data.
Hint: You may need to reshape the data within the function. You can use to do this.
:
## START FUNCTION
def trainmodelXtrain, ytrain:
# your code here
return
### END FUNCTION
data getyearpopAruba
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