Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we guess sport/activity for TCX from stats? #16

Open
mlt opened this issue Jul 21, 2012 · 0 comments
Open

Can we guess sport/activity for TCX from stats? #16

mlt opened this issue Jul 21, 2012 · 0 comments

Comments

@mlt
Copy link
Owner

mlt commented Jul 21, 2012

Unfortunately there is no way to tell ahead what that track is all about. It might be possible to deduce it for a particular user from one's track statistics. If median speed & IQR are somewhat high, we are probably biking, otherwise running.

Here is the pic with some stats. Red line results from natural breaks (jenks) split of mean speed into 2 classes.

stats

library(ggplot2)
library(classInt)

root <- "~/Documents/My Runs"
trk.lst <- list.files(root, "*.track$", full.names=TRUE, recursive=TRUE)

trk <- lapply(lapply(trk.lst, read.csv),
              function(x) {
                  x["x1"] <- NULL
                  x
              })
trk.all <- do.call(rbind, trk)

s <- with(all, Speed[Speed>0])
c <- classIntervals(s, 2, "jenks")
threshold <- c$brks[2]

pts.lst <- list.files(root, "*.points$", full.names=TRUE, recursive=TRUE)
pts <- lapply(pts.lst, read.csv, colClasses=c(Track="factor"))
pts.all <- do.call(rbind, pts)

ggplot(pts.all, aes(x=Track, y=Speed)) +
    geom_boxplot() + stat_summary(fun.y=mean, geom="point", shape=23) +
    geom_hline(aes(yintercept=threshold), colour="red") +
    theme_bw()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant