BaşlayınÜcretsiz başlayın

Build your cross validation pipeline

Now that we have our data, our train/test splits, our model, and our hyperparameter values, let's tell Spark how to cross validate our model so it can find the best combination of hyperparameters and return it to us.

Bu egzersiz, kursun bir parçasıdır

Building Recommendation Engines with PySpark

Kursa Göz Atın

Egzersiz talimatları

  • Create a CrossValidator called cv with our als model as the estimator, setting estimatorParamMaps to the param_grid you just built. Tell Spark that the evaluator to be used is the "evaluator" we built previously. Set the numFolds to 5.
  • Confirm that our cv was built by printing cv.

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

# Build cross validation using CrossValidator
____ = CrossValidator(estimator=____, estimatorParamMaps=____, evaluator=____, numFolds=____)

# Confirm cv was built
print(____)
Kodu Düzenle ve Çalıştır