Project - Bike Rental Forecasting

23 / 49

End to End Project - Bikes Assessment - Adding derived attributes and transforming the data

Adding derived features and transforming the data

These features can be derived from the raw set of features:

  1. isWorking: Is a workingday and not a holiday, 0: Is not a workingday and is a holiday

  2. monthCount: count of the number of months from the beginning of the dataset

  3. xformHr: transform by shifting the hours by 5 hrs, if the hours are greater than 5, we subtract 5, else we add 19.

  4. dayCnt: count of the days from the beginning of the dataset

  5. xformWorkHr: transforming the hour dataset to make the non-working days to have hours from 25 to 48

  6. cntDeTrended: De-trended count values

Task: Complete the statements for calculating each of the above derived attributes.

Hint

bikesData['isWorking'] = np.where(np.logical_and(bikesData.workingday==1,bikesData.holiday==0),1,0)
bikesData['monthCount'] = mnth_cnt(bikesData)
bikesData['xformHr'] = np.where(bikesData.hr>4,bikesData.hr-5,bikesData.hr+19)
bikesData['dayCount'] = pd.Series(range(bikesData.shape[0]))/24
bikesData['xformWorkHr'] = (1-bikesData.isWorking)*24 + bikesData.xformHr
bikesData['cntDeTrended'] = bikesData.cnt - bike_lm.predict(X)


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