Project - Bike Rental Forecasting

38 / 49

End to End Project - Bikes Assessment - Analyzing dataset - Box Plots Working Hours

Plotting box plots for 0900 and 1800 hrs working and non-working days

Contrary to the previous observation. there is perhaps an interaction between the time of day of working and nonworking days. A day of week effect is not apparent, but we may need to look in more detail. This idea is easy to explore.

Task: Adding the following code creates box plots for peak demand hours of working and nonworking days. Complete the code to box plot the bike counts for isWorking - [0,1] for these hours: [0900, 1800]

Hint

        labels = ["Boxplots of bike demand at 0900 \n\n", "Boxplots of bike demand at 1800 \n\n"]
        times = [8, 17]
        for lab, tms in zip(labels, times):
            temp = bikesData[bikesData.hr == tms]
            fig = plt.figure(figsize=(8, 6))
            fig.clf()
            ax = fig.gca()
            temp.boxplot(column = ['cntDeTrended'], by = ['isWorking'], ax = ax)
            plt.xlabel('')
            plt.ylabel('Number of bikes')
            plt.title(lab)
            plt.show()

Observations: Now we clearly see what we were missing in the initial set plots. There is a difference in demand between working and nonworking days at peak demand hours.

*Action: *

  • isWorking along with hr feature may be good to train the model.

  • xformWorkHr which is a derived feature from hr and isWorking can also be used instead of two features.


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...