Evrimodel: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Neal
imported>Jeremy
Line 9: Line 9:
===Description===
===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.
An [[EVRIModel_Objects|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).
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.
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|EVRIModel Objects page]].


====Optional Input====
====Optional Input====

Revision as of 15:34, 13 December 2013

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.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). When
When 'on', new data will be aligned to model before application.
When 'off', if the new data variables do not match the model's expected variables, an error will be thrown.
  • contributions: [ {'passed'} | 'used' | 'full' ] Governs detail of returned T^2 and Q contributions. Return contributions for:
'passed' = only the variables passed by the client in the order passed. This mode allows the client to easily map contributions back to passed data and is the preferred mode.
'used' = all variables used by the model including even variables which client did not provide. Variable order is that used by model and may not match the order passed by the client.
'full' = all variables used or excluded by the model, including even variables which client did not provide. Variable order is that used by model and may not match the order passed by the client.
  • 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.
If 'on', statistics are normalized using the value stored in the appropriate detail sub-field.
If 'off', statistics are returned as calculated.