Question: Write code of Python to perform a randomized search to find the potentially best hyperparameters of applying the AdaBoostRegressor model to the Boston house prices
Write code of Python to perform a randomized search to find the potentially best hyperparameters of applying the AdaBoostRegressor model to the Boston house prices dataset. Search in 30 random samples of parameter settings. Use the search parameter settings below, and output the best model instance, score, and parameter values.
base_estimator: None, a pipeline of feature scaling and the SVR
learning_rate: np.arange(0.1, 2, 0.1)
n_estimators: range(10, 101, 10)
Remarks (optional):
1. The Boston house prices dataset is deprecated in scikit-learn 1.0 and 1.1, and a warning message is displayed when the dataset is loaded. If you want to silent the warning message, use this code:
import warnings from sklearn.datasets
import load_boston
with warnings.catch_warnings():
warnings.simplefilter("ignore")
boston = load_boston()
2. To speed up a randomized search by using all processors, specify the parameter n_jobs=-1.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
