Skip to content
Browse files

A smidge of cleanup and merging trees

  • Loading branch information...
1 parent fa85698 commit 67c0b77ddf491bc8a89def45486734a3350be7d2 @laserson laserson committed
Showing with 15 additions and 3 deletions.
  1. +12 −2 src/debugging.R
  2. +3 −1 src/fitRandomForest.R
View
14 src/debugging.R
@@ -8,7 +8,7 @@ a <- mapreduce(input="~/temp/training.small.csv",
b <- from.dfs(a)
-training.data <- read.table("~/temp/training.small.csv",
+training.data <- read.table("~/temp/training.csv",
header=FALSE,
sep=",",
quote="\"",
@@ -33,4 +33,14 @@ training.data <- read.table("~/temp/training.small.csv",
saleDay="factor",
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")
View
4 src/fitRandomForest.R
@@ -117,4 +117,6 @@ mapreduce(input="/poisson/training.csv",
reduce=fit.trees,
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.
Something went wrong with that request. Please try again.