linearModelTraining is a support function for training linear models for partitions in all layers.
linearModelTraining(
DataT,
insigThs = 1e-08,
alpha = 0.05,
messageFlag = FALSE,
polyDegree = 1,
expFlag = FALSE
)This function returns models and DataT.
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].
is a DataT with DataT$nNodes, which is a number of total models from all layers.
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.
is a threshold to determine whether a magnitude of a feature coefficient is enough so that the feature is designated as a selected feature.
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.
is a flag. If it is true, the function shows the text regarding the progress of computing.
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=.".
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=.".
# Running linearModelTraining using simulation data
DataT<-SimpleSimulation(100,type=1)
obj<-linearModelTraining(DataT)
Run the code above in your browser using DataLab