Evrimodel: Difference between revisions
imported>Neal |
imported>Neal |
||
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. | |||
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. | |||
==== | ====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==== | |||
* | |||
===Options=== | ===Options=== | ||
options = a structure array with the following fields: | options = a structure array with the following fields: |
Revision as of 09:29, 23 October 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.
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
Options
options = a structure array with the following fields: