Extracting parameters
You've now tested 192 different models on the msd
dataset, and you found the best ROEM and its respective model (model 38).
You now need to extract the hyperparameters. The model_list
you created previously is provided here. It contains all 192 models you generated. Use the instructions below to extract the hyperparameters.
This exercise is part of the course
Building Recommendation Engines with PySpark
Exercise instructions
- Use list slicing to extract model 38 from the model list. Call this model
best_model
. - Use the
.get____()
method to extract the following hyperparameter values:Rank
MaxIter
RegParam
Alpha
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Extract the best_model
best_model = ____[____]
# Extract the Rank
print ("Rank: ", best_model.get___())
# Extract the MaxIter value
print ("MaxIter: ", ____.get____())
# Extract the RegParam value
print ("RegParam: ", best_model.____())
# Extract the Alpha value
print ("Alpha: ", ____.____())