JavaScript Predictor Object and Release Notes Version 8 5: Difference between pages

From Eigenvector Research Documentation Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Jeremy
 
imported>Lyle
No edit summary
 
Line 1: Line 1:
== Introduction ==


The JavaScript Predictor Object is freely available to developers who wish to create JavaScript applications that interface with Solo_Predictor as does the [[Solo Predictor Field Monitor]].
==Version 8.5==
Version 8.5 of PLS_Toolbox and Solo was released in September, 2017.


The object provides basic methods to get a list of available models (from a specific folder on the server), then apply those models to data stored in a [[DataCache object]] in Solo_Predictor. Finally, it also provides access to raw data, and Q or Hotelling's T-squared contributions (if the underlying model type provides contributions).
For general product information, see [http://www.eigenvector.com/software/pls_toolbox.htm PLS_Toolbox Product Page]. For information on Solo, see [http://www.eigenvector.com/software/solo.htm Solo Product Page].


== Available Models ==
(back to [[Release Notes PLS Toolbox and Solo]])


These properties and methods relate to the models that are available to Solo_Predictor and which of those should be applied to data when it is imported.
==Overview==


=== Properties ===
* The primary focus of version 8.5 has been in Calibration Transfer and additional importers.


{| border="1" cellspacing="0" cellpadding="5" style="margin-left:3em"
* PLS_Toolbox/Solo 8.5 has been tested extensively with Matlab 2017b prerelease and should be compatible with the coming release.
|-
|        <tt>.modelFolder</tt>      || Sets or retrieves the folder (on the server, that is the computer running Solo_Predictor) which should be searched for models to apply. When updated, the <tt>modelList</tt> property (see below) is automatically updated.
|-
|        <tt>.modelList</tt>      || '''[READ ONLY]''' An array of strings which define all valid files located in the modelFolder on the server. The contents of this list will be automatically updated when the <tt>modelFolder</tt> property is updated or when the <tt>updateModelList</tt> method is called.
|-
|        <tt>.modelListError</tt>      || '''[READ ONLY]''' The error (if any) returned after the last <tt>updateModelList</tt> call. If no error occurred, this property will be empty.
|-
|        <tt>.updateModelListCallback</tt>      || A function that should be executed when <tt>updateModelList</tt> is executed. The function should expect a single input consisting of the Predictor object itself. For example:[BR]
      obj.updateModelListCallback = function (myobj) {
        if (myobj.modelListError) throw new Error(myobj.modelListError);
        //Do something with myobj.modelList here...
      }
|}


=== Methods ===
* Simplified interface design changes. Various controls have been moved to simplify interfaces. Seldom used settings have been moved to options in several cases (e.g., simplified [[Svm|SVM]] panel).


* The Analysis window's confusion matrix and table toolbar icon now returns classification results for both [http://wiki.eigenvector.com/index.php?title=Sample_Classification_Predictions#Class_Pred_Most_Probable 'most probable'] and [http://wiki.eigenvector.com/index.php?title=Sample_Classification_Predictions#Class_Pred_Strict  'strict'] classifications. In the 'strict' case it also lists the 'strictthreshold' value used.


{| border="1" cellspacing="0" cellpadding="5" style="margin-left:3em"
==Calibration Transfer==
|-
* [[MCCTTool | New Model-centric Calibration Transfer]] - Interface to develop instrument specific models with calibration transfer.
|        <tt>.updateModelList</tt>      || Contacts the server and requests the current list of models (.MAT and .TXT files) in the specified <tt>modelFolder</tt>. When the server responds, the results are stored in the <tt>modelList</tt> and <tt>modelListError</tt> properties and finally a call is made to the function specified in <tt>updateModelListCallback</tt>. If any errors occurred, the modelList will be empty.
|}


* [[nlstd| NLSTD]] - Create or apply non-linear instrument transfer models (PLS_Toolbox only).


== Applying Models to Data ==
* [[sstcal| SST]] - Spectral Subspace Transformation calibration transfer.


The following properties and methods relate to applying models to data and retrieving those results. They all relate to the singular method <tt>applyModels</tt>.
* [[Demonstration_Datasets|Corn DSO]] - New calibration transfer demonstration data set added. 80 samples of corn measured on 3 different NIR spectrometers with moisture, oil, protein and starch values for each of the samples is also included.


=== Properties ===
==Importers==


These properties control the behavior of the <tt>applyModels</tt> method:
* [[shimadzueemreadr]] - Imports Shimadzu EEM formatted text files.
* [[visionairxmlreadr]] - Imports Vision Air formatted XML files (X- & Y-Blocks).
* [[pltreadr]] - Imports Vision Air model files (.plt).


{| border="1" cellspacing="0" cellpadding="5" style="margin-left:3em"
* [[aqualogreadr]] - Improved capability of loading multiple files containing samples of varying sizes (PLS_Toolbox only).
|-
|        <tt>.selectedModels</tt>      || An array of strings which indicate the names of models which should be applied. The model names can be taken from the <tt>modelList</tt> property defined above. If this array is empty, no models will be applied. If more than one model is listed, all models will be applied and Solo_Predictor will attempt to join all the results into a single results matrix. Changing the <tt>selectedModels</tt> list will generally cause the most recent results to be cleared.
|-
|        <tt>.datacacheblock</tt>      || Identifies which [[DataCache object]] block should be connected to the predictor as the source of data to which the models should be applied. Generally, this will be always be = 1, but some advanced applications might make use of additional DataCache blocks.
|-
|        <tt>.applyModelsCallback</tt>      || Provides a function that will be executed once the <tt>applyModels</tt> call has been completed. The supplied function should expect a single input consisting of the Predictor object itself.
|}


These properties are read-only and provide results from the most recent completed <tt>applyModels</tt> call:
* [[jascoeemreadr]] - Improved capability of loading multiple files containing samples of varying sizes (PLS_Toolbox only).


{| border="1" cellspacing="0" cellpadding="5" style="margin-left:3em"
* [[hitachieemreadr]] - Improved capability of loading multiple files containing samples of varying sizes (PLS_Toolbox only).
|-
|        <tt>.data</tt>      || '''[READ ONLY]''' The DataSet object-encoded contents that define the results of applying the model(s) to the specified data cache.
|-
|        <tt>.lastApplyUpdate</tt>      || '''[READ ONLY]''' The JavaScript timestamp of when the last call to <tt>applyModels</tt> was completed.
|-
|        <tt>.lastApplyError</tt>      || '''[READ ONLY]''' The text of any errors that occurred during the last call to <tt>applyModels</tt>. If no errors occurred in the last call, this property will be an empty string. Errors may be server-related errors (can not communicate) or model errors (e.g. data size does not match that expected by model)
|}


=== Methods ===
* [[rawread|RAWREAD]] - Added support for new version format (3 & 4) (See MIA_Toolbox).


{| border="1" cellspacing="0" cellpadding="5" style="margin-left:3em"
* [[spgreadr|SPGREADR]] Added new feature, options.spectrumindex now can be an integer, an array of integers (indices, & order doesn't matter), or 'all'. When loading multiple files, options.spectrumindex must be either a single value or 'all'.
|-
|        <tt>.applyModels</tt>      || Checks the server for new data in the indicated DataCache and applies any models listed in <tt>selectedModels</tt> to the data. When model application is done, the <tt>data</tt>, <tt>lastApplyUpdate</tt>, and <tt>lastApplyError</tt> properties are populated, and then the <tt>applyModelsCallback</tt> function is called.


'''Note:''' If no new data has appeared in the DataCache since the last <tt>applyModels</tt> call and the list of selected models hasn't changed, then the <tt>lastApplyUpdate</tt> timestamp is updated but ''no call will be made to the <tt>applyModelsCallback</tt> function''. That is, update calls which did not change the data or error properties will not trigger a call to <tt>applyModelsCallback</tt>. Internally this is known as a "nochange" response from Solo_Predictor and is intended to reduce load on the server and client when no new data or results are available.
==Exporters==
|}


== Contributions ==
* [[writeplt]] - Exports EVRI Model structures to Vision Air PLT files.


Once the Predictor has successfully applied the model(s) to data, the JavaScript Predictor has access to raw data, Q contributions, and T contributions (Hotelling's T^2 contributions). These are all obtained by a call to the dataDrill method as described below:
==Other Features and Improvements==
* [[Cooksd| Cook's Distance]] - Calculates Cooks Distance for samples in a regression model.


* [[rpls| RPLS]] - A recursive PLS and PCR variable selection algorithm.


{| border="1" cellspacing="0" cellpadding="5" style="margin-left:3em"
* [[manhattandist| MANHATTANDIST]] - Calculate Manhattan Distance between rows of a matrix.
|-
|valign="top" |        <tt>.dataDrill(mode,items,resultCallback)</tt>      || Makes a request to retrieve the contributions or data for one or more data points. The inputs include:
* mode = a single character string indicating what kind of contributions to retreive: 'd' = data, 't' = t contributions, 'q' = q contributions
* items = an array of one or more sample numbers for which the contributions should be returned. Zero-indexed relative to the results returned in the rows of the <tt>data</tt> property.
* resultCallback = a function which should be called with an input consisting of a single input containing the returned result.


The results will be an object with the fields:
* [[Confusionmatrix]] and [[Confusiontable]] - Classification results formatting options added. Can now specify use of mostprobable or strict classification rule.  
* '''result''' : an array of arrays with the requested data. The top level array contains one array for each requested index in "items".
* [[calcdifference]] - Calculate difference between two datasets.
* '''error''' : a string representation any errors that occurred during the call. Often, if error is non-empty, the '''result''' property will be empty.
* Added GLS Weighting to model optimizer.
* '''date''' : a string representation of the date and time the sever completed the request.
 
 
|}

Revision as of 09:35, 7 February 2019

Version 8.5

Version 8.5 of PLS_Toolbox and Solo was released in September, 2017.

For general product information, see PLS_Toolbox Product Page. For information on Solo, see Solo Product Page.

(back to Release Notes PLS Toolbox and Solo)

Overview

  • The primary focus of version 8.5 has been in Calibration Transfer and additional importers.
  • PLS_Toolbox/Solo 8.5 has been tested extensively with Matlab 2017b prerelease and should be compatible with the coming release.
  • Simplified interface design changes. Various controls have been moved to simplify interfaces. Seldom used settings have been moved to options in several cases (e.g., simplified SVM panel).
  • The Analysis window's confusion matrix and table toolbar icon now returns classification results for both 'most probable' and 'strict' classifications. In the 'strict' case it also lists the 'strictthreshold' value used.

Calibration Transfer

  • NLSTD - Create or apply non-linear instrument transfer models (PLS_Toolbox only).
  • SST - Spectral Subspace Transformation calibration transfer.
  • Corn DSO - New calibration transfer demonstration data set added. 80 samples of corn measured on 3 different NIR spectrometers with moisture, oil, protein and starch values for each of the samples is also included.

Importers

  • aqualogreadr - Improved capability of loading multiple files containing samples of varying sizes (PLS_Toolbox only).
  • jascoeemreadr - Improved capability of loading multiple files containing samples of varying sizes (PLS_Toolbox only).
  • hitachieemreadr - Improved capability of loading multiple files containing samples of varying sizes (PLS_Toolbox only).
  • RAWREAD - Added support for new version format (3 & 4) (See MIA_Toolbox).
  • SPGREADR Added new feature, options.spectrumindex now can be an integer, an array of integers (indices, & order doesn't matter), or 'all'. When loading multiple files, options.spectrumindex must be either a single value or 'all'.

Exporters

  • writeplt - Exports EVRI Model structures to Vision Air PLT files.

Other Features and Improvements

  • RPLS - A recursive PLS and PCR variable selection algorithm.
  • MANHATTANDIST - Calculate Manhattan Distance between rows of a matrix.
  • Confusionmatrix and Confusiontable - Classification results formatting options added. Can now specify use of mostprobable or strict classification rule.
  • calcdifference - Calculate difference between two datasets.
  • Added GLS Weighting to model optimizer.