https://www.wiki.eigenvector.com/index.php?title=Lreg&feed=atom&action=historyLreg - Revision history2024-03-29T01:35:51ZRevision history for this page on the wikiMediaWiki 1.39.6https://www.wiki.eigenvector.com/index.php?title=Lreg&diff=11146&oldid=prevScott: Created page with "===Purpose=== Predictions based on softmax multinomial logistic regression model. ===Synopsis=== : lreg - Launches an Analysis window with LREG as the selected method. : [m..."2020-09-13T19:16:31Z<p>Created page with "===Purpose=== Predictions based on softmax multinomial logistic regression model. ===Synopsis=== : lreg - Launches an Analysis window with LREG as the selected method. : [m..."</p>
<p><b>New page</b></p><div>===Purpose===<br />
<br />
Predictions based on softmax multinomial logistic regression model.<br />
<br />
===Synopsis===<br />
: lreg - Launches an Analysis window with LREG as the selected method. <br />
: [model] = lreg(x,options);<br />
: [model] = lreg(x,y,options);<br />
: [pred] = lreg(x,model,options);<br />
: [valid] = lreg(x,y,model,options);<br />
: [options] = lreg('options');<br />
<br />
Please note that the recommended way to build and apply an LREG model from the command line is to use the Model Object. Please see [[EVRIModel_Objects | this wiki page on building and applying models using the Model Object]]. <br />
<br />
===Description===<br />
<br />
Build an LREG model from input X and Y block data. Alternatively, if a model is passed in LREG makes a Y prediction for an input test X block.<br />
<br />
LREG solves for the logistic regression model parameters using the minFunc software: <br />
: M. Schmidt. minFunc: unconstrained differentiable multivariate optimization in Matlab. http://www.cs.ubc.ca/~schmidtm/Software/minFunc.html, 2005.<br />
<br />
====Inputs====<br />
<br />
* '''x''' = X-block (predictor block) class "double" or "dataset", containing numeric values,<br />
* '''y''' = Y-block (optional) class "double" sample class values,<br />
* '''model''' = previously generated model (when applying model to new data).<br />
<br />
====Outputs====<br />
<br />
* '''model''' = a standard model structure model with the following fields (see [[Standard Model Structure]]):<br />
** '''modeltype''': 'LREG',<br />
** '''datasource''': structure array with information about input data,<br />
** '''date''': date of creation,<br />
** '''time''': time of creation,<br />
** '''info''': additional model information,<br />
** '''pred''': 2 element cell array with<br />
*** model predictions for each input block (when options.blockdetail='normal' x-block predictions are not saved and this will be an empty array)<br />
** '''detail''': sub-structure with additional model details and results, including:<br />
*** model.detail.lreg: Structure containing 'lreg' matrix of model coefficients.<br />
<br />
* '''pred''' a structure, similar to '''model''' for the new data.<br />
<br />
====Algorithm====<br />
The 'algorithm' option allows selection of Logistic Regression wit no regularization ('none'), <br />
L2 regularization ('ridge'), L1 regularization ('lasso'), or equally weighted L1 and L2 regularization ('elasticnet').<br />
<br />
====Cross-validation====<br />
Cross-validation can be applied to LREG when using either the LREG Analysis window or the command line. From the Analysis window specify the cross-validation method in the usual way (clicking on the model icon's red check-mark, or the "Choose Cross-Validation" link in the flowchart).<br />
<br />
===Options===<br />
<br />
options = a structure array with the following fields:<br />
* '''display''' : [ 'off' |{'on'}] Governs display<br />
* '''plots''': [ {'none'} | 'final' ] governs plotting of results.<br />
* '''blockdetails''' : [ {'standard'} | 'all' ] extent of detail included in model. 'standard' keeps only y-block, 'all' keeps both x- and y- blocks.<br />
* '''waitbar''' : [ 'off' |{'auto'}| 'on' ] governs use of waitbar during analysis. 'auto' shows waitbar if delay will likely be longer than a reasonable waiting period.<br />
* '''algorithm''' : [ {'ridge'} | 'none' | 'lasso' | 'elasticnet'] specify the LREG implementation to use: <br />
: 'none' has no regularization,<br />
: 'ridge' uses L2 regularization,<br />
: 'lasso' uses L1 regularization, and<br />
: 'elasticnet' uses equally weighted L1 and L2 regularization..<br />
* '''maxIter''' : [400] Maximum number of iterations allowed in the minFunc optimization solver.<br />
* '''lambda''' : [{0.1}] Regularization parameter <br />
* '''preprocessing''': {[] []} preprocessing structures for x and y blocks (see PREPROCESS).<br />
* '''compression''': [{'none'}| 'pca' | 'pls' ] type of data compression to perform on the x-block prior to calculaing or applying the LREG model. 'pca' uses a simple PCA model to compress the information. 'pls' uses a pls model. Compression can make the LREG more stable and less prone to overfitting.<br />
* '''compressncomp''': [1] Number of latent variables (or principal components to include in the compression model.<br />
* '''compressmd''': [{'yes'} | 'no'] Use Mahalnobis Distance corrected.<br />
* '''cvmethod''' : [{'con'} | 'vet' | 'loo' | 'rnd'] CV method, OR [] for Kennard-Stone single split.<br />
* '''cvsplits''' : [{5}] Number of CV subsets.<br />
* '''cvi''' : ''M'' element vector with integer elements allowing user defined subsets. (cvi) is a vector with the same number of elements as x has rows i.e., length(cvi) = size(x,1). Each cvi(i) is defined as:<br />
::cvi(i) = -2 the sample is always in the test set.<br />
::cvi(i) = -1 the sample is always in the calibration set,<br />
::cvi(i) = 0 the sample is always never used, and<br />
::cvi(i) = 1,2,3... defines each test subset.<br />
<br />
====Usage from LREG Analysis window====<br />
See the lregdademo.m function for command line usage example.<br />
<br />
===See Also===<br />
<br />
[[analysis]], [[crossval]], [[preprocess]], [[lregda]], [[EVRIModel_Objects]]</div>Scott