Configure Logi Predict

Logi Predict is a Logi application that provides a complete, self-service, advanced analytics experience for users. This topic is intended for Logi developers and discusses how to configure the application after it's been installed.

Introductory information about Logi Predict can be found in About Logi Predict .
Directions for installing it can be found in Install Logi Predict - Windows and Install Logi Predict v3 - Linux.

About the Logi Predict Application

Logi Predict is a complete Logi Info application that allows end-users to employ advanced analytics to create predictions at runtime and it's intended to be used as installed.

 Unlike the Sample Applications on DevNet, Logi Predict is distributed complete with Logi Engine files - these include required code and you should not upgrade or downgrade this application to a different engine version or it may cease to work.

Developers should note that Logi Predict is an extremely advanced example of Logi Info programming. It uses highly customized code and specialized techniques that may not work if copied into other Logi applications. While you can customize some portions of it, pulling it apart and reusing code in other applications, as you might with a Logi Sample Application, may not work well.

Back to top

Completing the Installation

After the Logi Predict installer has finished, you need to do several things before you can use the Logi Predict application.

  1. Copy your Logi Info v12 license file, from any existing Logi Info v12 application folder or your Logi Info installation folder (typically C:\Program Files\LogiXML IES Dev\LogiStudio) and paste it into the PredictGo application folder, as shown above. For more detailed information about licenses, see Product Licensing

  1. Launch Logi Studio and open the PredictGo application by using Open Application and then navigating to and selecting the C:\Program Files\Logi Analytics\Logi Predict\PredictGo (or other installation) folder.

    For a .NET installation, if you see the red "Not registered..." status message shown above, register the application with the IIS server, using the Register link shown above.

  1. Now you can test the application installation by previewing its "goHome" report definition in Studio or running the application in your browser. It should look similar to the example above.

     If you chose to install R yourself, the first time you run Logi Predict it may need to download the R libraries. This could take 25 minutes or more, depending on your network connection speed and other factors. Please be patient.


  2. If you've just upgraded from an earlier version, you may see a message like the one shown above in red. This indicates that there have been R library changes that need to be applied before you use the upgraded application. Click the link to start the process, which will take less than a minute.

Your installation is now complete but... you must specify a datasource and metadata, as discussed in the next section, before it can be used.

Back to top

Connecting to Data

Logi Predict works with these database servers:

  • Microsoft SQL Server
  • MySQL
  • Oracle
  • PostgreSQL v9.1+
  • Redshift  

in a 64-bit OS environment.

Logi Predict takes advantage of two special data-handling elements, Metadata and Active Query Builder, which are installed with it to enable extended functionality in Studio and the application.

By default, data connections and metadata can be managed by all end-users, from within Logi Predict, at runtime.  

The side menu option shown above launches an embedded instance of the Web Metadata Builder and allows data connection and metadata creation and management. Step-by-step instructions for creating or editing a metadata file can be found in Using the Web Metadata Builder.

See the Configuring Security section below for information about restricting access to this feature.

You can also use the Web Metadata Builder tool in Studio to specify the data that will be available for use at runtime by creating a metadata file.

Metadata created externally can also be retrieved from a REST-style web service by specifying the service's URL in the Metadata element's Metadata Url attribute.

 If you want users to be able to select data using different metadata files at runtime, be sure to enumerate them as a comma-separated list in the goMetadataIDs constant. See the constants table on the next page for more information.

Back to top

Configuring the Scheduler

Logi Predict allows users to schedule prediction plan execution. This is an optional feature and you can skip this configuration section if you don't want to your users to use it.

 The scheduling feature is dependent on the Logi Scheduler, a service that must be installed as part of your Logi Info installation. If the Scheduler is not installed, you can re-run the Logi Info installer at any time and install it, or install it on Linux following the instructions in Introducing the Logi Scheduler.

Use the following steps to configure these features:

 

  1. Configure the Scheduler: In the Logi Predict application's _Settings definition, uncomment the goScheduler element, as shown above. Its default attributes will work in most scenarios. For more detailed information about other configurations, see Using the Logi Scheduler.


  2. Enable the Scheduler icons: In the _Settings definition, set the goSchedulerEnabled constant to True, as shown above. 

Once scheduling has been configured and enabled, an Add Schedule... button will appear in the controls for each prediction plan, as shown above. Users can click it at runtime to schedule plan runs. 

Scheduler Errors

If you run Logi Predict and, while working with Prediction Plans, receive an error message like this: 

The probably cause is that, in the _Settings definition, the goSchedulerEnabled constant has been set to True, but the Connection.Scheduler element ("goScheduler") has not yet been configured. Either set the constant to False or configure the connection to resolve the error.

Back to top

Managing Scheduled Prediction Plans

Logi Predict includes a Schedule Manager feature that lets users view and manage scheduled prediction plans.  

The side menu option shown above launches an embedded instance of the Schedule Manager (the goScheduleManager report definition) and allows management of scheduled prediction plan runs, right inside Logi Predict, at runtime. By default, it's available to all users; see the Configuring Security section below for information about restricting access to this feature. 

The Schedule Manager, shown above, provides an overview of all scheduled plans, across all users. 

Clicking the Clock icon for any entry will open the Schedule panel, shown above, revealing the schedule details.

Back to top

Configuring Security

By default, all of the features of Logi Predict are available to all users.

Logi Security can be used with Logi Predict to authenticate users and dynamically control access to application features and data. This is optional and you can skip this section if you don't want to use security. For information about Logi Security in general, see Introducing Logi Security.

 If you're not using Logi Security but want to permanently hide a feature, you can do so by remarking its side-bar menu item element in the PredictGo.goShared definition, under the sharedGoBox shared element, and by renaming the related definition file to prevent direct browsing. 

As shown above, to use Logi Security, add a Security element to the _Settings definition, along with whatever child elements are needed for your security scenario and configure them accordingly. Once this is done, certain Logi Predict features will be restricted by default.

Access to features and data is controlled using security Rights. In general, you can assign arbitrary string values for security Rights, but these standard Rights have specific purposes: 

Security Right Purpose

goDataManager

Enables the Data Manager page, allowing the creation and management of connections and metadata from inside Logi Predict, and displays an option in the menu.

goScheduleManager

Enables the Schedule Manager page, allowing the creation and management of scheduled prediction plans from inside Logi Predict, and displays an option in the menu.


As a Logi Info application, Logi Predict includes a standard logon page, which you can reference in the Security element's Logon Page and Logon Fail Page attributes. You can customize this page which is (assuming a default installation location):

C:\Program Files\Logi Analytics\Logi Predict\PredictGo\rdLogon.aspx

You can't edit .aspx pages in Logi Studio, so you'll need to use some other editing tool, like Notepad. 

Enable Data Manager

To enable the Data Manager, set the Security element's Metadata Admin Security Right IDs attribute to a value of Logi PredictDataManager.

To allow specific users to use the Data Manager to configure data, grant them the goDataManager security Right.

Access to the Web Metadata Builder tool can be disabled for all users by setting the General element's Disable Metadata Builder attribute equal to True, in the _Settings definition.

There are also two special opportunities to implement more granular data security in the Logi Predict application. Assuming you have Logi Security enabled: 

  1. When using the Web Metadata Builder, you can assign Security Right ID values to tables and to columns, as shown above. These tables and columns will only appear in Logi Predict data if the logged-in user has the matching security Rights.



  2. The Metadata element has its own Security Right ID attribute. In the _Settings definition fragment shown, there are three Metadata elements in use. Normally, all three would appear in the Model page's Data tab, in the Source selector. However, if the metaMarket element is configured with a Security Right ID, as shown above, then the logged-in user will only see it in the Source selector if he or she has the matching security Rights.

Enable Schedule Manager

To allow a user to use the Schedule Manager feature, grant them the goScheduleManager security Right.

Back to top

Configuring Logi Predict Constants

The application's _Settings definition includes several Logi Predict constants you may want to configure. These constants are: 

Constant Description

goCleanupCorrelationCutoff

Specifies a threshold for excluding highly-correlated columns from model training, if goCleanupSmartData = True. Correlated columns have a mutual relationship or connection in which they affect or depend upon one another. The default value is: 0.8 - meaning that column values that have a correlation of 80% or more will be excluded during training.

goCleanupFactorLevelCutoff

Specifies the maximum number of levels allowed before Categorical values will be excluded during training, if goCleanupSmartData = True. The default value is: 7

goCleanupNAString

Specifies the value that will be used to replace NAs (null or empty string values) in the data during training, if goCleanupSmartData = True. This provides a consistent "other" value for use during categorization in training. The default value is: "UnknownNA"

goCleanupNumericNACutoff

Specifies a threshold for excluding numeric columns containing NAs from model training, if goCleanupSmartData = True. The default value is: 0.4 - meaning that columns containing NAs in 40% or more of their values will be excluded during training.

goCleanupSmartDataClean

Specifies whether or not to apply "Smart Data Cleanup" during model training. The default value is: True

goDefaultModelName

Specifies the default name to be used when new model is created. The default value is: "Untitled Model"

goDefaultPlanName

Specifies the default name to be used when new prediction plan is created. The default value is: "Untitled Plan"

goRandomSeed

Specifies an optional static seed value for the generation of "reproducible" random values in the R Server. This is primarily useful when developing or debugging and reproducible results are desired. The default value is: 123

goSaveFileLocation

Specifies the location where model definition files will be stored. The default value is: @Function.AppPhysicalPath~/goSaveFiles

goSchedulerEnabled

Specifies whether the Logi Scheduler is available for use when creating Prediction Plans. If not enabled, the controls for creating and editing scheduled plan execution are not displayed. The default value is: True

rdScriptLocation

This constant is not created by default. If you choose to use Logi Predict with an existing R environment installation (one not installed by the Logi Predict installer) you must set this constant to the full path to Rscript.exe. Include the file name, but not the file extension. For example:

Windows: C:\Program Files\R-3.4.1\bin\RScript

Linux: /usr/lib64/R-3.4.1/bin/Rscript

SchedulerApplicationID

Specifies the ID that will be used for this task in the Logi Scheduler. The default value is: PredictGo.

Back to top

Customizing Logi Predict Files

In addition to setting the constants identified in the previous topic, Logi Predict can be customized or "branded" in several ways to make it look like "your" application. This is optional and you can skip this section if you have no need to do this.

All of the following definitions appear in Logi Studio's Application panel, in the goCustomizations folder: 

Reports

Customization Opportunity

goWebFooter

Used to customize copyright statement and other footer information.

goWebHeader

Used to customize logo, application title, and user icons. Includes icon for sidebar menu.


Support Files

Customization Opportunity

Custom.css

Add your own custom CSS classes here; be sure to include this file using a Style or Global Style element.

Custom.html

Include custom HTML for insertion within the HTML <Head> tags. Among other things, this is where you can specify the location of your Favicon file.

Custom.js

Include custom JavaScript for use within the application.

dmfAccuracyStats.xml

Definition Modifier code for the goAccuracyStats definition. A reference to this already exists in the definition.

dmfAnalysisGrid.xml

Definition Modifier code for the Analysis Grid element' used in several definitions. References to this is already exists in the definitions.

dfmClusterCats.xml

Definition Modifier code for the goClusterCats definition. A reference to this is already exists in the definition.

dfmClusterCenters.xml

Definition Modifier code for the goClusterCenters definition. A reference to this is already exists in the definition.

dfmClusterCrosstabChart.xml

Definition Modifier code for the goClusterCrosstabChart definition. A reference to this is already exists in the definition.

dfmColumnImportance.xml

Definition Modifier code for the goColumnImportance definition. A reference to this is already exists in the definition.

dmfGlossary.xml

Definition Modifier code for the goGlossary definition. A reference to this is already exists in the definition.

dmfHome.xml

Definition Modifier code for the goHome definition. A reference to this is already exists in the definition.

dmfImageList.xml

Definition Modifier code for the goImageList definition. A reference to this is already exists in the definition.

dmfMaster.xml

Definition Modifier code for the goMaster definition. A reference to this is already exists in the definition.

dmfMetadata.xml

Definition Modifier code for the goMetadata definition. A reference to this is already exists in the definition.

dmfModel.xml

Definition Modifier code for the goModel definition. A reference to this is already exists in the definition.

dmfModels.xml

Definition Modifier code for the goModels definition. A reference to this is already exists in the definition.

dmfNewModelPopup.xml

Definition Modifier code for the goNewModelPopup definition. A reference to this is already exists in the definition.

dmfPlan.xml

Definition Modifier code for the goPlan definition. A reference to this is already exists in the definition.

dmfPlans.xml

Definition Modifier code for the goPlans definition. A reference to this is already exists in the definition.

dmfPredictedAg.xml

Definition Modifier code for the goPredictedAg definition. A reference to this is already exists in the definition.

dmfScheduleManager.xml

Definition Modifier code for the goScheduleManager definition. A reference to this is already exists in the definition.

dmfSchedulerPopup.xml

Definition Modifier code for the goSchedulerPopup definition. A reference to this is already exists in the definition.

dmfTrainingColumnsPopup.xml

Definition Modifier code for the goTrainingColumnsPopup definition. A reference to this is already exists in the definition.

Using Definition Modifier Files

You can use a Logi Info feature called a Definition Modifier File (DMF) to customize many aspects of the Logi Predict UI. Logi Predict has been pre-coded for DMFs and provides the necessary blank template files (all of the files in the table above whose names begin with "dmf") for the purpose. Use the link above to get a basic understanding of how DMFs work.

 Logi Predict definitions may change when new versions are released and, if you use DMFs, you may have to edit them when you upgrade to a new version.

Let's look at two examples of DMFs in action. There are several places in Logi Predict where the you can select the "data volume" to be used in operations, and we'll use DMFs to change the data volume options available in the UI.  

Example 1 - Classification Model: Determining Column Importance

When you're creating a Classification Model, a feature called Column Importance lets you see how columns are used in the model.  

By default, you can select data volumes of 1000, 5000, and 25000 rows, as shown above, for the related calculation. Let's use a DMF to add more data volume options.

In Logi Studio, locate and open the file SupportFilesgoCustomizationsdfmColumnImportance.xml, which provides DMF code for the goColumnImportance definition. Add the <SetAttribute ... /> code shown below to it, so that it looks like this: 

<DefinitionModifier>
    <!-- Modify PredictGo definitions by entering DefinitionModifierFile command elements here. -->
    <SetAttribute XPath="//InputSelectList[@ID='RandomRowSelection']/DataLayer" Type="XMLFile" XMLFile="goCustomizations.MyDataRowOptions.xml" />
</DefinitionModifier> 

The <SetAttribute ... /> code may wrap to a second line in your browser display but it should all be on one line in the file.

In operation, the code uses XPath notation to identify an Input Select List element with an ID of "RandomRowSelection" in the goColumnImportance definition and then finds its DataLayer element. It changes the datalayer's Type attribute to "XMLFile" and its XMLFile attribute to the name of an .xml file that will hold our alternate data volume options. Save the file.

Next, in Logi Studio create a new XML file in SupportFilesgoCustomizations and rename it MyDataRowOptions.xml. Then edit it to have this data: 

<RowOptions>
   <Option Caption="Statistical sample of up to 500 rows" Value="500"/>
   <Option Caption="Statistical sample of up to 1,000 rows" Value="1000"/>
   <Option Caption="Statistical sample of up to 5,000 rows" Value="5000"/>
   <Option Caption="Statistical sample of up to 10,000 rows" Value="10000"/>
   <Option Caption="Statistical sample of up to 25,000 rows" Value="25000"/>
   <Option Caption="Statistical sample of up to 50,000 rows" Value="50000"/>
</RowOptions>

Save the file and re-run Logi Predict: 

Your new data volume options are now available, as shown above.

Example 2 - All Models: Model Training Data Volume

The same technique can be used to change the Data Volume options for the model trainings.

To achieve this, you use the exact same <SetAttribute ... /> code from the previous example, but instead add it to SupportFilesgoCustomizationsdfmModel.xml file. The "before" and "after" effects are shown above. 

DMFs provides the potential for many similar kinds of customizations. Explore the code and see what you can achieve.

Back to top

Customizing Appearance

You can also change the basic look of the application by changing its theme, which is configured in the _Settings definition.

The default is an included custom theme named PredictGo and is specified in the Global Style element but, as shown above, you can use other themes. For more information, see Working with Themes.

Back to top

Embedding Logi Predict

The Logi Predict application can be embedded into other Logi applications or into non-Logi HTML pages. You may need to take steps to avoid browser Mixed Content (HTTP-to-HTTPS or vice versa) or Cross-Origin Resource restrictions.

Our Logi Predict REST API may serve your needs; it allows you to run predictions for specific values, without embedding. For more information, see Logi Predict API

Embedding using Logi Embedded Reports API

Our Embedded Reports API is a JavaScript-based API that works well with all modern browsers and offers several easy methods for embedding Logi Predict into other applications.  

Embedding in an iFrame without SecureKey

The following example shows one way to embed Logi Predict into another Logi application using an iFrame, but without using Logi Secure Key. 

As shown above, an Include HTML element is added to the report definition. Width control is exercised by placing it inside a container, like an HTML table Column Cell or a Division, whose width can be set. Here's the HTML code to include: 

<script language="javascript" type="text/javascript">
   function resizeIframe(obj) {
      obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
   }
</script>

<iframe src='http://yourServer/PredictGo' style="width: 100%; min-height: 1200px;
  frameborder: false;" frameborder='0' onload='javascript:resizeIframe(this);' "
  scrolling="noquot;>
</iframe>

The same code can be used to embed Logi Predict into a non-Logi application.  

Embedding in an iFrame with SecureKey

If you want to embed Logi Predict using an iFrame and make use of Logi SecureKey authentication, you first have to get the SecureKey value from the Logi Predict application. 

One way to do this is shown above. Under a Local Data element, DataLayer.CSV is used to retrieve the key value. This datalayer type is used because it can use a URL to retrieve the data. Its CSV File attribute value will be similar to:

http://yourServer/PredictGo/rdTemplate/rdGetSecureKey.aspx?UserName=@Function.UserName~&
UserID=@Function.UserID~&Roles=@Function.UserRoles~

That retrieves one row into Local Data, with a column named SKey, containing the SecureKey value. Then, using the same embedded script from the previous example: 

<script language="javascript" type="text/javascript">
   function resizeIframe(obj) {
      obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
   }
</script>

<iframe src='http://yourServer/PredictGo/?rdSecureKey=@Local.SKey~ style="width: 100%;
 min-height: 1200px; frameborder: false;" frameborder='0'
 onload='javascript:resizeIframe(this);' " scrolling="no">
</iframe>

Add the rdSecureKey parameter and Local Data token, shown in blue above, to the iFrame source URL to complete the authentication process when embedding the Logi Predict application.

Back to top