Create a Statistical Model Template (supported in v6.x and earlier)
Statistical Model Templates define how Stats Model data are processed. Users can create custom templates to run specific statistical calculations, based on the data anomalies that need to be surfaced. This article describes how to add a new Statistical Model Template to your Metric Insights instance.
NOTE: Writing the code for a Statistical Model Template is a technically advanced process. Please contact [email protected] for assistance with writing the correct code for a new template.
1. Create a New Stats Model Template
Access Admin > System > Stats Model Templates
The list page containing all Stats Model Templates available in the system opens.
- Below the grid, click [+ New Stats Dataset Template]
- Enter a Name for the Stats Template
- [Save]
2. Enter Dataset Viewer Code
Access the Dataset Viewer Code tab
- Enter the HTML for the Stats Model Editor
- Once the Statistical Model Template is saved and selected in the Stats Model Editor, the menu is displayed based on this code
3. Enter Javascript Code
Access the Javascript Code tab
Enter the JavaScript code that is used to provide functionality for the HTML code entered in the previous step. This script processes the Dataset data to find any anomalies, which will serve as a basis for the future Stats Model.
4. Enter Statement Generation Code
4.1. Enter Code for MySQL
Access the Statement Generation Code tab
Enter the code that will generate a MySQL query based on the data collected by the script.
5. Use the Stats Model Template
Access the Dataset Viewer of a Dataset, on which you want to build a Stats Model
- Select Actions > Build Stats Model
- Click on the Template field
- Select the created Stats Model Template
For more details on creating a Stats Model, see Create a Statistical Model (Datasets).