Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dimRedResult-class

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

## 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)

dimRed

A Framework for Dimensionality Reduction

v0.2.3
GPL-3 | file LICENSE
Authors
Guido Kraemer [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.