1
$\begingroup$

Assuming we are considering following classification problem:

We have a dataset containing the time when a user call a taxi in one day, but different users call the taxi different times. For example:

User  Time 
1   7:00    11:00   13:00   16:00           
2   7:01    12:30   17:30               
3   7:30    9:30    11:00   11:45   12:50   16:00   18:00
4   6:30    23:00                   
5   9:00    11:00   13:00   17:00           
6   9:00    17:30                   

Let say, User 1,2,5,6 can be classified as one group and User 3 and User 4 are the other two group. And in the User 1,2,5,6 is looks like User 1,2 can be viewed as a subgroup and User 5,6 may be another subgroup.

If I want to this kind of classification, what is the possible method? Should I apply some preprocess procedure to transform the data into a square shape? Or there are methods can trade this kind of data without preprocessing?

I am not sure this problem is well-posed. Any discussion is welcomed.

$\endgroup$

1 Answer 1

2
$\begingroup$

For this kind of data I would recommend to convert the data into integer values to make them easier to compare, but this step could also be omitted. E.g. you could have a function like:

time = 60 * hour + minutes

Next question would be how to compare the data. Is it more important for you to categorize the users by the time he/she calls a taxi or how often per day he/she calls a taxi.

One approach to preprocess the data could be to split a 24 hour day into time periods of 30 minutes or 1h and rearrange the data like:

time  ...  7:01-8:00  8:01-9:00 ...
User1 ...  0          0         ...
User2 ...  1          0         ...
User3 ...  1          0         ...
User4 ...  0          0         ...
User5 ...  0          1         ...
User6 ...  0          1         ...

Where the values are the taxies called in this time; could also be just a boolean value. By setting the box sizes different properties can be observed like in the morning, afternoon, night or something different. Also the times must not start at 0 am, the could also start at the minimum time which occurs and go to the maximum, which would remove rows that are completely zero.

With this new matrix we can apply a distance function like the euclidean distance.

Based on the resulting distance matrix on could apply some clustering technique like Principal Component Analysis, Hierarchical Clustering, k-Means or some other clustering method you prefer.

Important for the results is the size of the time-step you choose. A bigger time-step would lead to more similarities between the users. To round this up, I would say, that this kind of preprocessing leads to an identification of users, that call taxies to equal times.

$\endgroup$
3
  • $\begingroup$ Yes, split continuous variable to discrete variable is a good approach for this kind of job. $\endgroup$
    – Kattern
    Commented May 9, 2015 at 15:42
  • $\begingroup$ Did you test it and does it perform well on your data? $\endgroup$
    – Alex VII
    Commented May 10, 2015 at 8:30
  • $\begingroup$ Yes, the result is reasonable, but not perfect as I expected. The main reason is the data is not sensitive in the question like 7:00 to 7:10 should has similar effect to the result. But for my actual data, 37.15 and 37.64 reflect great changes of the regression result, which cannot be reflected from the split data. $\endgroup$
    – Kattern
    Commented May 11, 2015 at 1:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.