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
Building Recommendation Engines with PySpark
kursunun bir parçasıdırEgzersiz talimatları
- Create a
CrossValidatorcalledcvwith ouralsmodel as the estimator, settingestimatorParamMapsto theparam_gridyou just built. Tell Spark that theevaluatorto be used is the"evaluator"we built previously. Set thenumFoldsto 5. - Confirm that our
cvwas built by printingcv.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
# Build cross validation using CrossValidator
____ = CrossValidator(estimator=____, estimatorParamMaps=____, evaluator=____, numFolds=____)
# Confirm cv was built
print(____)