Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (45 sloc) 2.09 KB
with(a, text3D(a$GameID, a$ActionsInPAC, a$GapBetweenPACs,
labels = rownames(a),
col = gg.col(100), theta = 60, phi = 20,
xlab = "Game ID's", ylab = "Actions in PACs", zlab = "Gap Between PACs",
main = "Players PACs", cex = 0.6,
bty = "g", ticktype = "detailed", d = 2, adj = 0.5, font = 2))
# Add points
with(a, scatter3D(a$GameID, a$ActionsInPAC, a$GapBetweenPACs - 1, col = gg.col(100),
type = "h", pch = ".", add = TRUE))
scatter2D(a$GameID, a$ActionsInPAC, pch = 16, bty ="n",
type ="b")
text3D(a$GameID, a$ActionsInPAC, a$GapBetweenPACs,
labels = rownames(a),
col = gg.col(100), theta = 60, phi = 20,
xlab = "Game ID's", ylab = "Actions in PACs", zlab = "Gap Between PACs",
main = "Players PACs", cex = 0.6,
bty = "g", ticktype = "detailed", d = 2, adj = 0.5, font = 2)
scatter3D(a$GameID, a$ActionsInPAC, a$GapBetweenPACs - 1, col = gg.col(100),
type = "h", pch = ".", add = TRUE)
x <- a$LeagueIndex
y <- a$NumberOfPACs
z <- a$GapBetweenPACs
fit <- lm(z ~ x + y)
# predict values on regular xy grid
grid.lines = 26
x.pred <- seq(min(x), max(x), length.out = grid.lines)
y.pred <- seq(min(y), max(y), length.out = grid.lines)
xy <- expand.grid( x = x.pred, y = y.pred)
z.pred <- matrix(predict(fit, newdata = xy),
nrow = grid.lines, ncol = grid.lines)
# fitted points for droplines to surface
fitpoints <- predict(fit)
# scatter plot with regression plane
scatter3D(x, y, z, pch = 18, cex = 2,
theta = 20, phi = 20, ticktype = "detailed",
xlab = "League Index", ylab = "Number of PACs", zlab = "Gap Between PACs",
surf = list(x = x.pred, y = y.pred, z = z.pred,
facets = NA, fit = fitpoints), main = "Number of PACs in League Indexes")
set.seed(123)
RF_Starcraft <- randomForest(
formula = a$GameID ~ .,
data = a
)
varImpPlot(RF_Starcraft)
plot(RF_Starcraft)
You can’t perform that action at this time.