Learn R Programming

dimRed (version 0.2.0)

dimRedResult-class: Class "dimRedResult"

Description

A class to hold the results of of a dimensionality reduction.

Usage

# S4 method for dimRedResult
predict(object, xnew)

# S4 method for dimRedResult inverse(object, ynew)

# S4 method for dimRedResult as.data.frame(x, org.data.prefix = "org.", meta.prefix = "meta.", data.prefix = "")

# S4 method for dimRedResult getPars(object)

# S4 method for dimRedResult getNDim(object)

# S4 method for dimRedResult print(x)

# S4 method for dimRedResult getOrgData(object)

# S4 method for dimRedResult getDimRedData(object)

# S4 method for dimRedResult ndims(object)

# S4 method for dimRedResult getOtherData(object)

Arguments

object

Of class dimRedResult

xnew

new data, of type dimRedData

ynew

embedded data, of type dimRedData

x

Of class dimRedResult

org.data.prefix

Prefix for the columns of the org.data slot.

meta.prefix

Prefix for the columns of x@data@meta.

data.prefix

Prefix for the columns of x@data@data.

Methods (by generic)

  • predict: apply a trained method to new data, does not work with all methods, will give an error if there is no apply. 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 no inverse. In some cases the apply function may only be an approximation.

  • as.data.frame: convert to data.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

data

Output data of class dimRedData.

org.data

original data, a matrix.

apply

a function to apply the method to out-of-sampledata, may not exist.

inverse

a function to calculate the original coordinates from reduced space, may not exist.

has.org.data

logical, if the original data is included in the object.

has.apply

logical, if a forward method is exists.

has.inverse

logical if an inverse method exists.

method

saves the method used.

pars

saves the parameters used.

other.data

other data produced by the method, e.g. a distance matrix.

Examples

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

# }

Run the code above in your browser using DataLab