linearModelTraining: linearModelTraining

View source: R/linearModelTraining.R

linearModelTrainingR Documentation

linearModelTraining

Description

linearModelTraining is a support function for training linear models for partitions in all layers.

Usage

linearModelTraining(
  DataT,
  insigThs = 1e-08,
  alpha = 0.05,
  messageFlag = FALSE,
  polyDegree = 1,
  expFlag = FALSE
)

Arguments

DataT

contains a multiresolution dataset s.t. DataT$X[i,d] is a value of feature d of individual i, DataT$Y[i] is value of target variable of individual i that we want to fit DataT$Y ~ DataT$X in linear model, and clsLayer[i,j] is a cluster ID of individual i at layer j; clsLayer[i,1] is the first layer that everyone typically belongs to a single cluster.

insigThs

is a threshold to determine whether a magnitude of a feature coefficient is enough so that the feature is designated as a selected feature.

alpha

is a significance level to determine whether a magnitude of a feature coefficient is enough so that the feature is designated as a selected feature.

messageFlag

is a flag. If it is true, the function shows the text regarding the progress of computing.

polyDegree

is a degree of polynomial function that is used to fit the data. If it is greater than 1, the polynomial formula is used in lm() instead of "y=.".

expFlag

is an exponential flag to control the formula for data fitting. If it is true, then the exp() formula is used in lm() instead of "y=.".

Value

This function returns models and DataT.

models

models[[j]][[k]] is a linear model of a cluster ID k at the layer j. The models[[j]][[k]]$selFeatureSet represents a set of selected-feature indices of the model where the feature index 1 is the intercept, and the feature index d is the (d-1)th variable DataT$X[,d-1].

DataT

is a DataT with DataT$nNodes, which is a number of total models from all layers.

Examples

# Running linearModelTraining using simulation data
DataT<-SimpleSimulation(100,type=1)
obj<-linearModelTraining(DataT)


DarkEyes/MRReg documentation built on Aug. 24, 2022, 5:47 p.m.