Assignment 4
MGMT 638: Data-Driven Investments: Equity
Rice University
Split the Boston house price data into train and test sets with test_size=0.2. Do the following for (i) Random ForestRegressor, (ii) MLPRegressor, and (iii) Lasso.
- Use GridSearchCV on the training data to find the best hyperparameter.
- Compute the \(R^2\) on the test data for the best hyperparameter.
For RandomForestRegressor, use
{"max_depth": range(2, 22, 2)} param_grid =
For MLPRegressor, use
{"hidden_layer_sizes": [[100], [100, 100], [100, 100, 100]]} param_grid =
For Lasso, use
{"alpha": np.arange(0.1, 2.1, 0.1)} param_grid =