Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
A smidge of cleanup and merging trees
  • Loading branch information
laserson committed Feb 22, 2013
1 parent fa85698 commit 67c0b77
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 12 additions & 2 deletions src/debugging.R
Expand Up @@ -8,7 +8,7 @@ a <- mapreduce(input="~/temp/training.small.csv",
b <- from.dfs(a) b <- from.dfs(a)




training.data <- read.table("~/temp/training.small.csv", training.data <- read.table("~/temp/training.csv",
header=FALSE, header=FALSE,
sep=",", sep=",",
quote="\"", quote="\"",
Expand All @@ -33,4 +33,14 @@ training.data <- read.table("~/temp/training.small.csv",
saleDay="factor", saleDay="factor",
Stick_Length="numeric")) Stick_Length="numeric"))


a <- randomForest(formula=model.formula, data=training.data, na.action=na.roughfix, ntree=10) a <- randomForest(formula=model.formula, data=training.data, na.action=na.roughfix, ntree=10)



# Figure
library(ggplot2)
x <- seq(0, 10, len=10000)
y <- exp(-x) * 100
p <- qplot(x, y, geom="line", xlab=expression(KM/N), ylab="Percent of initial data set missed")
p + geom_line(mapping=aes(x=c(0, 1, 1), y=c(exp(-1)*100, exp(-1)*100, 0)), color="gray") +
geom_point(mapping=aes(x=1, y=exp(-1)*100), color="gray")
4 changes: 3 additions & 1 deletion src/fitRandomForest.R
Expand Up @@ -117,4 +117,6 @@ mapreduce(input="/poisson/training.csv",
reduce=fit.trees, reduce=fit.trees,
output="/poisson/output") output="/poisson/output")


forests <- from.dfs("/poisson/output")[["val"]] raw.forests <- from.dfs("/poisson/output")[["val"]]
forest <- do.call(combine, raw.forests)

0 comments on commit 67c0b77

Please sign in to comment.