Project - Bike Rental Forecasting

45 / 49

End to End Project - Bikes Assessment - Finding hyper parameters

Fine-tuning the model

Task 1: Assign different combination of max_dept and min_samples_leaf and min_samples_split to param_grid - 'max_depth': [28, 30, 32, 34, 36], 'min_samples_leaf': [5, 10, 15, 12],'min_samples_split': [120, 128, 136]

Task 2: Calculate the best parameter using GridSearchCV and store it in grid_search. Print the parameters.

Hint

        from sklearn.model_selection import GridSearchCV
        param_grid = [
            {'max_depth': [28, 30, 32, 34, 36], 'min_samples_leaf': [5, 10, 15, 12],'min_samples_split': [120, 128, 136]},
        ]

        grid_search = GridSearchCV(rfc_clf, param_grid, cv=5, scoring='neg_mean_squared_error')
        grid_search.fit(train_set[['xformHr', 'temp','weekday']], train_set['cntDeTrended'])
        print(grid_search.best_params_)

        feature_importances = grid_search.best_estimator_.feature_importances_

Task 3: Fit the training dataset to the calculated best parameter model using the fit() method.

Task 4: Complete the code to calculate the importance score for each of the feature.


No hints are availble for this assesment

Answer is not availble for this assesment


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...