RandomizedSearchCV लागू करना
आप उम्मीद कर रहे हैं कि एक random search एल्गोरिदम इस्तेमाल करने से क्लास असाइनमेंट के लिए आपकी predictions बेहतर होंगी. आपके प्रोफेसर ने आपकी क्लास को समग्र final exam के औसत स्कोर की भविष्यवाणी करने की चुनौती दी है.
Random search पूरी करने की तैयारी में आपने ये बना लिए हैं:
param_dist: hyperparameter distributionsrfr: एक random forest regression मॉडलscorer: उपयोग करने के लिए एक scoring method
यह अभ्यास पाठ्यक्रम का हिस्सा है
Python में Model Validation
अभ्यास निर्देश
sklearnमें random search चलाने के लिए आवश्यक मेथड लोड करें.- random search पूरा करने के लिए ये पैरामीटर भरें:
estimator,param_distributions, औरscoring. - इस random search के लिए 5-fold cross-validation का उपयोग करें.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Import the method for random search
from sklearn.model_selection import ____
# Build a random search using param_dist, rfr, and scorer
random_search =\
____(
estimator=___,
param_distributions=____,
n_iter=10,
cv=____,
scoring=____)