Machine Learning - Diagnostic - Model Simulator extension

From Q
Jump to navigation Jump to search
This page is currently under construction, or it refers to features which are under development and not yet available for use.
This page is under construction. Its contents are only visible to developers!

This tool creates a new page containing a simulator for your predictive model. This is sometimes referred to as a "typing tool". The simulator allows you to enter new values for the Predictor variables in your model and to see what the predicted value is for that combination, based on your model. The simulator works with Regression models and Machine Learning models.

When the Outcome variable in your model is numeric, the simulator will provide one output showing the predicted value for your selection. When your Outcome variable is categorical, the simulator will create two outputs, with the first showing the predicted category, and the second showing the probabilities of the possible outcomes for your selection.

Usage

To create a simulator:

  1. Create a predictive model using one of the options in Anyting > Advanced Analysis > Regression or Anything > Advanced Analysis > Machine Learning.
  2. Select the model output on your page.
  3. Select DIAGNOSTICS > Create Simulator on the right of your screen.
  4. Format and arrange the labels, controls, and outputs from the simulator to your preferred appearance.

Technical Details

If you have categorical Predictor variables in your model that have empty categories you will not be able to simulate values for those categories. You can remove these ahead of time (before creating the simulator) by creating table of the relevant Variable Set, selecting the label for the empty category, and pressing Delete, or you can simply remove those labels from the simulator once it has been added to the page, by selecting the combo box, going in to Control > Item list on the right and deleting the label for the empty category.


How to apply this QScript

  • Start typing the name of the QScript into the Search features and data box in the top right of the Q window.
  • Click on the QScript when it appears in the QScripts and Rules section of the search results.

OR

  • Select Automate > Browse Online Library.
  • Select this QScript from the list.

Customizing the QScript

This QScript is written in JavaScript and can be customized by copying and modifying the JavaScript.

Customizing QScripts in Q4.11 and more recent versions

  • Start typing the name of the QScript into the Search features and data box in the top right of the Q window.
  • Hover your mouse over the QScript when it appears in the QScripts and Rules section of the search results.
  • Press Edit a Copy (bottom-left corner of the preview).
  • Modify the JavaScript (see QScripts for more detail on this).
  • Either:
    • Run the QScript, by pressing the blue triangle button.
    • Save the QScript and run it at a later time, using Automate > Run QScript (Macro) from File.

Customizing QScripts in older versions

  • Copy the JavaScript shown on this page.
  • Create a new text file, giving it a file extension of .QScript. See here for more information about how to do this.
  • Modify the JavaScript (see QScripts for more detail on this).
  • Run the file using Automate > Run QScript (Macro) from File.

JavaScript

includeWeb('QScript Functions for Model Simulator');

createPredictiveModelSimulator();

See also