CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

Building Recommendation Engines with PySpark

Afficher le cours

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

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de 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: ", ____.____())
Modifier et exécuter le code