JavaScript Predictor Object and Evri faq: Difference between pages

From Eigenvector Research Documentation Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Jeremy
 
imported>Lyle
 
Line 1: Line 1:
== Introduction ==
__TOC___
==Importing / Exporting==


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]].
[[faq_concatenate_multiple_files|How do I concatenate multiple files into a single DataSet?]]


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).
[[faq_create_multivariate_image_from_separate_images|How do I create a multivariate image from separate images?]]


== Available Models ==
[[faq_export_PCA_scores_and_loadings_to_text_file|How do I export PCA scores and loadings to a text file (to read into MS Excel, for example)?]]


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.
[[faq_import_three-way_data|How do I import three-way data into Solo or PLS_Toolbox?]]


=== Properties ===
[[faq_import_horiba_NGC_64bit |Why can't I import a Horiba NGC file on my 64-bit computer?]]


{| border="1" cellspacing="0" cellpadding="5" style="margin-left:3em"
[[faq_SPCREADR_cant_read_multiple_files |Why can't SPCREADR read multiple files I've selected?]]
|-
|        <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 ===
[[faq_some_EXCEL_files_fail_to_import |Why do some Excel files fail to import?]]


==General==


{| border="1" cellspacing="0" cellpadding="5" style="margin-left:3em"
[[faq_PARALIND_in_PLS_Toolbox |Can I do PARALIND in PLS_Toolbox?]]
|-
|        <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.
|}


[[faq_install_on_more_than_one_PC | Can I install PLS_Toolbox (or Solo) on more than one PC, such as on my desktop and laptop computer?]]


== Applying Models to Data ==
[[faq_multiple_class_sets_together_in_SIMCA_PLSDA_LDA | Can I use multiple class sets (categorical variables) together in a SIMCA, PLSDA, or LDA model?]]


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>.
[[faq_more_info_on_R_Squared_statistic | Can you give me more information on the R-Squared statistic?]]


=== Properties ===
[[faq_how_RMSEC_and_RMSECV_related to R2Y_and_Q2Y_seen_other_software | How are RMSEC and RMSECV related to R2Y and Q2Y I see in other software?]]


These properties control the behavior of the <tt>applyModels</tt> method:
[[faq_convergence_of_PARAFAC| Convergence of PARAFAC. How much variation between models is expected a particular PARAFAC is fit multiple times with the same settings?]]


{| border="1" cellspacing="0" cellpadding="5" style="margin-left:3em"
[[faq_does_software_stop_working_if_maintenance_expires | Does the software stop working if my maintenance expires?]]
|-
|        <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:
[[faq_report_a_problem_with_PLS_Toolbox | How and where do I report a problem with PLS_Toolbox?]]


{| border="1" cellspacing="0" cellpadding="5" style="margin-left:3em"
[[faq_how_are_T_contributions_calculated | How are T-contributions calculated?]]
|-
|        <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 ===
[[faq_how_are_ROC_curves_calculated_for_PLSDA | How are the ROC curves calculated for PLSDA?]]


{| border="1" cellspacing="0" cellpadding="5" style="margin-left:3em"
[[faq_how_are_error_bars_calculated_regression_model | How are the error bars calculated for a regression model and can they be related to a confidence limit (confidence in the prediction)?]]
|-
|        <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.
[[faq_improve_performance_with_PLS_Toolbx_and_Matlab_on_Mac | How can I improve performance with PLS_Toolbox and Matlab on the Mac platform?]]
|}


== Contributions ==
[[faq_assign_classes_for_samples_in_a_DataSet | How do I assign classes for samples in a DataSet?]]


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:
[[faq_build_a_classification_model_from_class_set_other_than_the_first | How do I build a classification model from a class set other than the first?]]


[[faq_choose_between_different_cross_validation_leave_out_options | How do I choose between the different cross-validation leave-out options?]]


{| border="1" cellspacing="0" cellpadding="5" style="margin-left:3em"
[[faq_reference_Eigenvector| How do I cite/reference Eigenvector?]]
|-
|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:
[[faq_interpret_ROC_curves_and_Sensitivity_Specificity_plots_from_PLSDA | How do I interpret the ROC curves and Sensitivity / Specificity plots from PLSDA?]]
* '''result''' : an array of arrays with the requested data. The top level array contains one array for each requested index in "items".
* '''error''' : a string representation any errors that occurred during the call. Often, if error is non-empty, the '''result''' property will be empty.
* '''date''' : a string representation of the date and time the sever completed the request.


[[faq_make_DataSet_backwards_compatible | How do I make a DataSet backwards compatible?]]


|}
[[faq_obtain_or_use_recompilation_license_for_PLS_Toolbox | How do I obtain or use a recompilation license for PLS_Toolbox?]]
 
[[faq_use_custom_cross_validation_option | How do I use the "custom" cross-validation option?]]
 
[[faq_out_of_memory_error_when_analyzing_data | I keep getting "out of memory" errors when analyzing my data. What can I do?]]
 
[[faq_java_lang_OutOfMemoryError| What can I do if I get a java.lang.OutOfMemoryError error?]]
 
[[faq_why_get_negative_scores_when_all_modes_are_set_to_nonnegativity | Nonnegativity (PARAFAC, PARAFAC2, Tucker): Why do I get negative scores when all modes are set to nonnegativity?]]
 
[[faq_what_are_relative_contributions | What are "Relative Contributions"?]]
 
[[faq_what_are_reduced_T^2_and_Q_Statistics | What are the "Reduced" T<sup>2</sup> and Q Statistics?]]
 
[[faq_units_for_RMSEC_and_RMSECV_for_PLSDA | What are the units used for RMSEC and RMSECV when cross-validating PLSDA models?  Why do the cross-validation curves look strange for PLSDA?]]
 
[[faq_what_do_the_four_Fit_/_Unique_Fit_stats_mean_in_MCR_PARAFAC | What do the four Fit/Unique Fit statistics mean in MCR and PARAFAC models?]]
 
[[faq_internal_tests_used_to_select_suggested_number_of_PCs | What internal tests are used to select "suggested" number of PCs?]]
 
[[faq_what_is_PLS1_v_PLS2_and_how_to_create_separate_PLS1_models_from_multi_column_y_block | What is PLS1 vs PLS2 and how do I create separate PLS1 models when I have a multi-column y-block?]]
 
[[faq_difference_between_a_loading_and_a_weighting | What is the difference between a loading and a weighting?]]
 
[[faq_why_some_axis_labels_and_titles_upside_down_in_MIA_Toolbox | Why are some axis labels and titles on my axes upside-down when I'm viewing images in MIA_Toolbox?]]
 
[[faq_why_can't_I_recompile_PLS_Toolbox_functions | Why can't I recompile the PLS_Toolbox functions?]]
 
[[faq_why_get_missing_data_warning| Why do I get the warning/notice "Missing Data Found - Replacing with "best guess" from existing model. Results may be affected by this action."]]
 
[[faq_why_PLS_Toolbox_have_a_boxplot_function_that_conflicts_with_Stats_Toolbox | Why does PLS_Toolbox have a "boxplot" function that conflicts with the Mathworks Statistics Toolbox function of the same name?]]
 
[[faq_why_R2014b_give_error_cannot_convert_double_value_to_a_handle | Why does R2014b give me "Error using matlab.ui.Figure... Cannot convert double value to a handle" (or similar)?]]
 
==Command Line==
[[faq_specify_all_options_of_a_function_or_only_those_different_from_defaults | Do I have to specify all the options to a function or only the ones that are different from the defaults?]]
 
[[faq_how_are_Q_residuals_and_Hotellings_T2_calculated_in_PLS_models | How are the Q-residuals and Hotelling's T<sup>2</sup> values calculated for PLS models?]]
 
[[faq_how_to_automate_PCA_analysis_for_multiple_images  | How do I automate PCA analysis for multiple images?]]
 
[[faq_how_do_I_calculate_my_own_T2_and_Q_limits | How do I calculate my own T<sup>2</sup> and Q limits?]]
 
[[faq_how_do_manually_calculate_the_limits_for_scores | How do I manually calculate the limits for scores?]]
 
[[faq_how_do_I_calculate_scores_from_a_PLS_or_PLSDA_model | How do I calculate scores from a PLS or PLSDA model?]]
 
[[faq_how_do_I_change_the_default_options_for_a_function | How do I change the default options for a function?]]
 
[[faq_how_do_I_interpret_the_misclassification_results_reported_by_crossval | How do I interpret the Misclassification results reported by crossval?]]
 
[[faq_how_do_I_make_PlotGUI_send_plot_to_a_new_figure_and_not_overwrite_current_figure | How do I make PlotGUI send its plot to a new figure and not overwrite the current figure?]]
 
[[faq_how_do_I_retrieve_and_display_predictions_from_a_model_structure_in_command_window | How do I retrieve and display predictions from a model structure in the command window?]]
 
==Manual==
==GUI==
==Installation==
 
 
 
 
 
 
 
[[Category:FAQ]]

Revision as of 13:26, 5 December 2018

_

Importing / Exporting

How do I concatenate multiple files into a single DataSet?

How do I create a multivariate image from separate images?

How do I export PCA scores and loadings to a text file (to read into MS Excel, for example)?

How do I import three-way data into Solo or PLS_Toolbox?

Why can't I import a Horiba NGC file on my 64-bit computer?

Why can't SPCREADR read multiple files I've selected?

Why do some Excel files fail to import?

General

Can I do PARALIND in PLS_Toolbox?

Can I install PLS_Toolbox (or Solo) on more than one PC, such as on my desktop and laptop computer?

Can I use multiple class sets (categorical variables) together in a SIMCA, PLSDA, or LDA model?

Can you give me more information on the R-Squared statistic?

How are RMSEC and RMSECV related to R2Y and Q2Y I see in other software?

Convergence of PARAFAC. How much variation between models is expected a particular PARAFAC is fit multiple times with the same settings?

Does the software stop working if my maintenance expires?

How and where do I report a problem with PLS_Toolbox?

How are T-contributions calculated?

How are the ROC curves calculated for PLSDA?

How are the error bars calculated for a regression model and can they be related to a confidence limit (confidence in the prediction)?

How can I improve performance with PLS_Toolbox and Matlab on the Mac platform?

How do I assign classes for samples in a DataSet?

How do I build a classification model from a class set other than the first?

How do I choose between the different cross-validation leave-out options?

How do I cite/reference Eigenvector?

How do I interpret the ROC curves and Sensitivity / Specificity plots from PLSDA?

How do I make a DataSet backwards compatible?

How do I obtain or use a recompilation license for PLS_Toolbox?

How do I use the "custom" cross-validation option?

I keep getting "out of memory" errors when analyzing my data. What can I do?

What can I do if I get a java.lang.OutOfMemoryError error?

Nonnegativity (PARAFAC, PARAFAC2, Tucker): Why do I get negative scores when all modes are set to nonnegativity?

What are "Relative Contributions"?

What are the "Reduced" T2 and Q Statistics?

What are the units used for RMSEC and RMSECV when cross-validating PLSDA models? Why do the cross-validation curves look strange for PLSDA?

What do the four Fit/Unique Fit statistics mean in MCR and PARAFAC models?

What internal tests are used to select "suggested" number of PCs?

What is PLS1 vs PLS2 and how do I create separate PLS1 models when I have a multi-column y-block?

What is the difference between a loading and a weighting?

Why are some axis labels and titles on my axes upside-down when I'm viewing images in MIA_Toolbox?

Why can't I recompile the PLS_Toolbox functions?

Why do I get the warning/notice "Missing Data Found - Replacing with "best guess" from existing model. Results may be affected by this action."

Why does PLS_Toolbox have a "boxplot" function that conflicts with the Mathworks Statistics Toolbox function of the same name?

Why does R2014b give me "Error using matlab.ui.Figure... Cannot convert double value to a handle" (or similar)?

Command Line

Do I have to specify all the options to a function or only the ones that are different from the defaults?

How are the Q-residuals and Hotelling's T2 values calculated for PLS models?

How do I automate PCA analysis for multiple images?

How do I calculate my own T2 and Q limits?

How do I manually calculate the limits for scores?

How do I calculate scores from a PLS or PLSDA model?

How do I change the default options for a function?

How do I interpret the Misclassification results reported by crossval?

How do I make PlotGUI send its plot to a new figure and not overwrite the current figure?

How do I retrieve and display predictions from a model structure in the command window?

Manual

GUI

Installation