Evrimodel
purpose
Build an EVRI Model Object.
Synopsis
- model = evrimodel(modeltype); %creates a model object of type (modeltype)
- model = evrimodel; %creates a generic model object
Description
An EVRIModel object is a generic object that contains a standard Eigenvector model object. The model can be either "empty" (uncalibrated), "calibrated", or "applied" (prediction on new data). The examples below show building and applying a model using the object's built-in methods.
Model objects are also output from numerous PLS_Toolbox functions (in the calibrated or applied state.) The content of these models can be interrogated through the model properties (the object fields available depend on the model type and can be accessed through the "fieldnames" method).
The models can also be used through the standard methods as described below.
For details on how to work with the objects, the the EVRIModel Objects page.
Optional Input
- modeltype = standard model object type to create. E.g. 'pls','pca'.
Output
- model = standard model object of type (modeltype)
Examples
- BUILD MODEL
m = evrimodel('pls'); %creates an empty PLS model object m.x = x; %assigns data to the X-block (predictor) m.y = y; %assigns data to the Y-block (predictand) m.ncomp = ncomp; %sets the number of components in the model m.options = options; %assigns model options with a standard options structure m = m.calibrate; %performs calibration method
- CROSS-VALIDATE MODEL
m.crossvalidate(x,cvi)
- APPLY MODEL
p = m.apply(data)
- PLOT CONTENTS
m.plotscores m.plotloads m.ploteigen
Properties
The following properties can be modified through SETPLSPREF using
setplspref('evrimodel','property',value)
The properties govern model method behavior and include the following:
General options
- noobject: [ {false} | true ] Disables object use altogether.
- usecache: [ {false} | true ] Governs use of model cache when models are calibrated or applied using object methods.
Type and class testing options
- stricttesting: [ false | {true} ] Give warning/error when code tests a model by using "isstruct" or "isfield(...,'modeltype'). Best practices are to avoid these methods and use ismodel() instead. This option helps detect code where the poor practices are used.
- strictmodeltype: [ false | {true} ] Give warning/error when a model type is changed to either an undefined model type or from one model type to an incompatible model type.
- fatalalerts: [ {false} | true ] Governs whether above tests give warnings (false) or throw errors (true).
Display options
These settings govern the command-line output for models.
- desc: [ false | {true} ] Governs display of model summary details (same as model.info).
- contents: [ {false} | true ] Governs display of model fields and summary of their contents (old format of display).
Model application options
- plots: [ {'none'} | 'final' ] Governs showing of plots when model is calibrated or applied to new data.
- display: [ {'off'} | 'on' ] Governs display of information at the command line when the model is calibrated or applied to new data.
- matchvars: [ 'off' | {'on'} ] Governs use of variable alignment when apply the model to new data (matchvars). For details, see EVRIModel Objects
- contributions: [ {'passed'} | 'used' | 'full' ] Governs detail of returned T^2 and Q contributions. For details, see EVRIModel Objects
- reducedstats: [ {'off'} | 'on' ] Governs whether Q and T^2 statistics from models are "reduced" using the confidence limit set in the model.detail.reslim and model.detail.tsqlim fields. For details, see EVRIModel Objects