| dimRedResult-class {dimRed} | R Documentation |
Class "dimRedResult"
Description
A class to hold the results of of a dimensionality reduction.
Usage
## S4 method for signature 'dimRedResult'
predict(object, xnew)
## S4 method for signature 'dimRedResult'
inverse(object, ynew)
## S4 method for signature 'dimRedResult'
as.data.frame(
x,
org.data.prefix = "org.",
meta.prefix = "meta.",
data.prefix = ""
)
## S4 method for signature 'dimRedResult'
getPars(object)
## S4 method for signature 'dimRedResult'
getNDim(object)
## S4 method for signature 'dimRedResult'
print(x)
## S4 method for signature 'dimRedResult'
getOrgData(object)
## S4 method for signature 'dimRedResult'
getDimRedData(object)
## S4 method for signature 'dimRedResult'
ndims(object)
## S4 method for signature 'dimRedResult'
getOtherData(object)
Arguments
object |
Of class |
xnew |
new data, of type |
ynew |
embedded data, of type |
x |
Of class |
org.data.prefix |
Prefix for the columns of the org.data slot. |
meta.prefix |
Prefix for the columns of |
data.prefix |
Prefix for the columns of |
Methods (by generic)
-
predict: apply a trained method to new data, does not work with all methods, will give an error if there is noapply. In some cases the apply function may only be an approximation. -
inverse: inverse transformation of embedded data, does not work with all methods, will give an error if there is noinverse. In some cases the apply function may only be an approximation. -
as.data.frame: convert todata.frame -
getPars: Get the parameters with which the method was called. -
getNDim: Get the number of embedding dimensions. -
print: Method for printing. -
getOrgData: Get the original data and meta.data -
getDimRedData: Get the embedded data -
ndims: Extract the number of embedding dimensions. -
getOtherData: Get other data produced by the method
Slots
dataOutput data of class dimRedData.
org.dataoriginal data, a matrix.
applya function to apply the method to out-of-sampledata, may not exist.
inversea function to calculate the original coordinates from reduced space, may not exist.
has.org.datalogical, if the original data is included in the object.
has.applylogical, if a forward method is exists.
has.inverselogical if an inverse method exists.
methodsaves the method used.
parssaves the parameters used.
other.dataother data produced by the method, e.g. a distance matrix.
Examples
## Create object by embedding data
iris.pca <- embed(loadDataSet("Iris"), "PCA")
## Convert the result to a data.frame
head(as(iris.pca, "data.frame"))
head(as.data.frame(iris.pca))
## There are no nameclashes to avoid here:
head(as.data.frame(iris.pca,
org.data.prefix = "",
meta.prefix = "",
data.prefix = ""))
## Print it more or less nicely:
print(iris.pca)
## Get the embedded data as a dimRedData object:
getDimRedData(iris.pca)
## Get the original data including meta information:
getOrgData(iris.pca)
## Get the number of variables:
ndims(iris.pca)