stam.fit {stam} | R Documentation

## Fit StAM Model to Training Data

### Description

Using the whole expression data provided fit one StAM model according to the chosen shrinkage level.

### Usage

    stam.fit(cv, expression.matrix, collapse.scnodes = FALSE,
             alpha = 0.5, delta = NULL, max.nodes = 100)

### Arguments

`cv` | result stam.cv on the same data, must be of class `stamCV`
`expression.matrix` | holds the expression levels. It may be of class exprSet or a plain numeric matrix. In the first case `exprs` is used to extract the expression levels. The matrix is expected to hold one column per sample and one row per probeset.
`collapse.scnodes` | if set to TRUE replace single children nodes after shrinkage
`alpha` | root performance vs. mean redundancy weight. If set to NULL the root error rate is used exclusively to determine the best shrinkage level. If a numeric vector is provided, all alternatives are computed and the user is given an interactive choice. Values between 0 and 1 are valid, 0 meaning exclusive weight on redundancy and 1 putting exclusive weight on performance.
`delta` | overrule alpha and set shrinkage level explicitely.
`max.nodes` | choose default shrinkage level such that no more than this number of nodes remain after shrinkage.

### Details

In a first step `stam.fit` must choose a shrinkage level. In order to do so it uses results stored in the cv. If the user provides a shrinkage level explicitly this `delta` is used. If he specifies a single weighting factor `alpha` the corresponding weighted score is used to determine the best shrinkage level. If `alpha` is set to a vector of values, the corresponding scores are computed and a default `delta` is suggested using the median value of the `alphas`. If this shrinkage level leads to more than `max.nodes` nodes remaining the shrinkage level is increase until no more than `max.nodes` remain after shrinkage.

Using the thus determined shrinkage level a weighting of nodes is computed using the leaf node results from `cv`. Thereby, the whole dataset supplied is used.

### Value

An object of class stamFit is returned. You may use the print and plot methods to further investigate the returned value.

### Author(s)

Claudio Lottaz

### See Also

`stam.cv`, `stamFit-class`, `plot.stamFit`, `stam.graph.plot`, `stam.writeHTML`

### Examples

    # load and prepare some data
    golubTrain <- golubNorm[,1:38]
    data(golubTrain.cv)

    # compute fit
    golubTrain.fit <- stam.fit(golubTrain.cv, golubTrain, alpha=seq(0, 1, 0.1))

    # investigate
    print(golubTrain.fit)
    plot(golubTrain.fit)

    # show clickable web-page
    ## Not run:
    map <- stam.graph.plot(golubTrain.fit, outfile="golubTrain")
    cat("<HTML><BODY><MAP NAME='graph_map'>", map, "</MAP>",
        "<IMG SRC='golubTrain_graph_plot.png' USEMAP='#graph_map'></BODY></HTML>\n",
        file="graph_plot.html")
    browseURL(paste("file://", getwd(), "/graph_plot.html", sep=""))
    ## End(Not run)

[Package stam version 1.0.9 Index]