predict.wccsom: Predict properties from self-organising maps

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/predict.wccsom.R

Description

Function to predict property values for every unit in a supervised or unsupervised SOM. These, in turn, are used to provide predictions for individual objects.

Usage

1
2
3
## S3 method for class 'wccsom'
predict(object, newdata,
               trainX, trainY, unit.predictions, ...)

Arguments

object

Trained SOM.

newdata

If new objects are supplied (in the form of a matrix), they are mapped to the SOM; predictions for the new data are the predicted values associated with the units to which they are mapped. In order to calculate these the maps should be either supervised, or the training data should be stored in the map, or these data should be provided through arguments '"trainX"' and '"trainY"', or finally, the unit predictions can be explicitly given ('"unit.predictions"').

trainX

Training data, only used when they have not been stored in the trained map.

trainY

Dependent values for the training data.

unit.predictions

Alternatively, one can provide predictions for every unit.

...

Not used.

Details

For supervised SOMs, predictions per unit are available after training. For unsupervised SOMs, these predictions can be obtained from the average values of the properties of training set objects mapping to specific units. New objects that are mapped to the SOM will receive the predicted value of the unit to which they are mapped.

Value

The function returns a list with components

unit.predictions

Property predictions per unit of the map.

predictions

Property predictions for the new data.

Author(s)

R. Wehrens

References

~put references to the literature/web site here ~

See Also

wccsom, wccxyf, plot.wccsom

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
data(degelder)
gr <- somgrid(5, 5, "hexagonal")
set.seed(7)
x <- wccxyf(degelder$patterns, degelder$properties[,"cell.vol"],
            grid=gr, trwidth=20, rlen=100)
plot(x, "predict")

predicted.volumes <- predict(x)
plot(degelder$properties[,"cell.vol"], predicted.volumes$predictions,
     xlab="Cell volume", ylab="Predicted cell volume")
abline(0,1, col="gray")

## End(Not run)

wccsom documentation built on May 30, 2017, 12:52 a.m.