PredPsych (version 0.1)

DimensionRed: Generic Dimensionallity Reduction Function

Description

A simple function to perform dimensionality reduction

Usage

DimensionRed(Data, method = "MDS", selectedCols, outcome = NA,
  plot = FALSE, ...)

Arguments

Data

(dataframe) a data frame with variable/feature columns

method

(optional) (character) Dimensionality reduction method to be used

selectedCols

(optional)(numeric) which columns should be treated as data(features/columns) (defaults to all columns)

outcome

(optional)(vector) optional vector for visualising plots

plot

(optional)(logical) To plot or not to plot

...

(optional) additional arguments for the function

Value

Data frame with Results

Details

Dimensionality Reduction is the process of reducing the dimensions of the dataset. Multivariate data, even though are useful in getting an overall understanding of the underlying phenomena, do not permit easy interpretability. Moreover, variables in such data often are correlated with each other .For these reasons, it might be imperative to reduce the dimensions of the data. Various models have been developed for such dimensionality reduction. Of these, MDS and PCA has been demonstrated in the current implementation.

Examples

Run this code
# reducing dimension of Grip aperture from 10 to 2
GripAperture <- DimensionRed(KinData,selectedCols = 12:21,
outcome = KinData[,"Object.Size"],plot = TRUE)

Run the code above in your browser using DataLab