मॉडल की गुणवत्ता का आकलन
अब मॉडल की गुणवत्ता का आकलन शुरू करने का समय है.
यहाँ, आप Ames हाउसिंग डेटा पर क्रॉस-वैलिडेटेड XGBoost मॉडल के RMSE और MAE की तुलना करेंगे. पिछले अभ्यासों की तरह, सभी आवश्यक मॉड्यूल प्रीलोड किए गए हैं और डेटा DataFrame df में उपलब्ध है.
यह अभ्यास पाठ्यक्रम का हिस्सा है
XGBoost के साथ Extreme Gradient Boosting
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Create the DMatrix: housing_dmatrix
housing_dmatrix = xgb.DMatrix(data=X, label=y)
# Create the parameter dictionary: params
params = {"objective":"reg:squarederror", "max_depth":4}
# Perform cross-validation: cv_results
cv_results = ____(dtrain=____, params=____, nfold=____, num_boost_round=____, metrics=____, as_pandas=True, seed=123)
# Print cv_results
print(cv_results)
# Extract and print final boosting round metric
print((cv_results["____"]).tail(1))