Project - Bike Rental Forecasting - Basic

31 / 32

End to End Project - Bikes Assessment - Basic - Evaluate the model on test - Preparing to test the final model on Test dataset

Now, since, we got the best (final) model (using Grid Search) for this problem, let us use the same on the 'Test' data set to predict the 'cnt' values and then compare the predicted values to the actual values.

INSTRUCTIONS

Please follow the below steps:

  • Store the best estimator (that we got in Grid Search) into a variable final_model

  • Sort the values of test_set by 'dayCount' (axis=0 and inplace=True)

    test_set.sort_values(<<your code comes here>>, axis= 0, inplace=True)
    
  • Drop the cnt column(feature) from test_set dataframe (axis=1) and save the rest of the columns(features) into test_x_cols variable. test_x_cols now contains the list of columns(features) in the form of strings.

    test_x_cols = (test_set.<<your code comes here>>, axis=1)).columns.values
    
  • Save the cnt string in test_y_cols variable. test_y_cols contains only one string i.e. cnt which is basically the target label that we need to predict.

  • Extract the values of test_x_cols columns(features) of test_set dataframe and store them in X_test dataframe variable.

    X_test = test_set.loc[:,<<your code comes here>>]
    
  • Extract the value of test_y_cols column of test_set dataframe and store it in y_test variable.

    y_test = test_set.loc[:,<<your code comes here>>]
    
Get Hint

Answer is not availble for this assesment


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

Loading comments...