huiminren/MTrajRec

Hour feature has some problem

Opened this issue · 0 comments

In datasets.py file, def get_pro_features function

    def get_pro_features(self, ds_pt_list, hours, weather_dict):
        holiday = is_holiday(ds_pt_list[0].time)*1
        day = ds_pt_list[0].time.day
        # TODO: check hour data have some questions,
        hour = {'hour': np.bincount(hours).max()}  # find most frequent hours as hour of the trajectory
        weather = {'weather': weather_dict[(day, hour['hour'])]}
        features = self.one_hot(hour) + self.one_hot(weather) + [holiday]
        return features

I thought you mean get the frequent hours as hour of the trajectory, just like if I have hours = [12,12,12,12,13], the hour=12 but the code

hour = {'hour': np.bincount(hours).max()}  # find most frequent hours as hour of the trajectory

seems to get the number of the frequent hours, i.e. hour=4, not the hour.

So, I wanna know is my understanding correct, or is it other meaning?