Description Usage Arguments Examples
Function that performs Model Path Selection (MPS)
1 2 3 4 5 6 7 8 9 10 11 12 | full.select.gen(
myframe,
resp.name,
depth,
r,
f,
type,
model,
fun.args,
pred.args,
condense = FALSE
)
|
myframe |
data.frame holding explanatory and response data |
resp.name |
matrix of MPS data |
depth |
maximum depth of paths |
r |
maximum cell count |
f |
loss function |
type |
'reg' or 'class' for regression and classification. Not needed if |
model |
name of modeling method; must be name of the function called in R |
fun.args |
list of arguments that are passed to modeling function |
pred.args |
list of arguments that are passed to model predict function |
condense |
logical for whether or not paths should be merged |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | set.seed(200)
library(MASS)
n<-1000
p<-10
x<-mvrnorm(n,rep(0,p),diag(p))
signal<-rowSums(x[,1:3])
noise<-rnorm(n,0,1/4)
y<-signal+noise
mydata<-data.frame(x,y)
mps1<-full.select.gen(myframe=mydata,resp.name='y',depth=3,
B=100,model='lm',condense=FALSE)
mps1
build.tree(mps1) #graph
#merged paths
mps2<-full.select.gen(myframe=mydata,resp.name='y',depth=3,
r=100,model='lm',condense=TRUE)
mps2
build.tree(mps2) #graph
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.