A year or two ago I wrote a keylogger that has been quietly running in the background of my computer. Each line consists of a timestamp, a keycode, and a value representing modifier keys (e.g. ctrl, shift, etc.).
Separately, I have a web app that I use to manually make notes about how I spend my time: TaskRanger.com
As you can see in this screenshot, Task Ranger is basically a daily log of work done. Each day consists of a list of intervals. Each interval consists of a start time, a duration, and a string briefly describing the work I did during that period. The description also contains a twitter style hashtag that manually classifies the type of work I was doing.
I'm interested in combining both of these data sources to create a classifier that can take a raw log of keystrokes as input and output a sequence of tags indicating the type of work I did over time. For example, I might have been doing research from 11am to 1pm, then planning a project from 1pm to 2:30, then alternating between coding and debugging for the next few hours, etc.
The intent is to basically build a personal profiler. I want to become more productive. And I think I ought to be able to treat my workflow as a software program: figure out what the bottlenecks are, drill down into them, and focus my improvement efforts on those areas.
I tried to build some kind of naive classifier myself without much luck. One problem is I couldn't find an easy way to figure out when one kind of work ends and the next kind begins (segmentation I think it's called?). I think this whole classification task might be a lot harder than it initially seems. I have this vague idea that a Hidden Markov Model should work. Basically the type of work that I'm doing is a hidden state, and the keylogs provide clues as to that state. But I know next to nothing about signal processing or machine learning, so I'm not sure if I'm on the right track here.
Any advice or suggestions on how to build this would be appreciated. Some sample code demonstrating something similar would be especially useful.