1
$\begingroup$

I have a unix shell data. Each session starts with <begin> and <end>. Between <begin> and <end>, the info contains users command in the shell session. From this data, I need to figure out how many users are on the system with probability.

For example, the is something like this:

<begin>
pwd
cd ~
<end>
<begin>
ls
vi
<end>
<begin>
cat
ls
pwd
<end>

I have put this data into this type of data frame:

head(result,20)

  user  dat
     1  elm
     2 gzip
     2  <1>
     2   ls
     2   ci
     2   -l
     2  <1>
    2   ci
    2   -l
    2  <1>
    2   ci
    2   -l
    2  <1>
    2   ci
    2   -l
    2  <1>
    2   ls
    2   ls
    2  <1>
   2   ls

I need this dat to be like this:

user ls cd vi cat
 1   5   0  0  0
 2   3   2  5   6

etc,

any ideas how I would do this?

$\endgroup$
  • 3
    $\begingroup$ This question is unclear. At the moment it seems there is no any connection between input data and the number of users. $\endgroup$ – sashkello Jan 22 '14 at 3:19
1
$\begingroup$

I assume that you don't have any labeled data, i.e., no sets of sessions that you know they belong to the same user.

Of course you also make the assumption that the same user will use more or less the same commands, and different users will use more or less different commands.

If so, then it sounds like you have a clustering problem where you try to discover the number of clusters. This wikipedia page on finding the number of clusters in a dataset is a good starting point.

N.B. It would be hard though to validate your results without having some ground truth.

$\endgroup$
  • $\begingroup$ @illiafl, yes that's exactly right. Based on the command per user, I need to figure out how many approximate users are there and probability. $\endgroup$ – user115479 Jan 22 '14 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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