Learn R Programming

wccsom (version 1.2.11)

predict.wccsom: Predict properties from self-organising maps

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

"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.

Value

The function returns a list with components
unit.predictions
Property predictions per unit of the map.
predictions
Property predictions for the new data.

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.

References

~put references to the literature/web site here ~

See Also

wccsom, wccxyf, plot.wccsom

Examples

Run this code
## 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)

Run the code above in your browser using DataLab