Skip to main content

PredictionSimulator

Versions

v1.0.0

Basic Information

Class Name: PredictionSimulator

Title: Prediction Simulator

Version: 1.0.0

Author: Gavin Stops

Organization: OneStream

Creation Date: 2024-07-30

Default Routine Memory Capacity: 2 GB

Tags

Data Transformation, Data Simulator, Time Series, Data Preprocessing, Data Analysis

Description

Short Description

A SensibleAI Forecast simulator for users to run jobs against any project through the configure phase.

Long Description

This routine is a replacement for the SIM solution. Users can run jobs against their projects, so long as the project is through the Dataload step in SensibleAI Forecast. The available jobs to run are Pipeline, Deploy, Prediction, Rebuild, and Project Copy. A user will not be responsible for data update jobs when using this routine. The user will instead upload all of the available source data for a given project, and the routine will take care of updating the source data based on dates the user provides for respective job types. This goes for both Target and Feature data. Jobs will run in the order specified in the simulator method, and if one of the jobs in the routine fails, all subsequent jobs will be cancelled.

Use Cases

1. Run Multiple Jobs Overnight

A SensibleAI Forecast user is looking to run a project through multiple jobs throughout the night, but this user doesn't want to set an alarm for the middle of the night so they can kick off their second prediction. Instead this user can utilize the prediction simulator routine. The user has a project named Project Z. They get Project Z through the dataload step in SensibleAI Forecast. They then go through the configure phase setting any of the parameters they need to fine tune their project. Then, before they run pipeline, they switch over to SensibleAI Studio to utilize this routine. They create an instance of the prediction simulator by uploading the full target and feature datasets. Then they invoke this instance to run a pipeline job, a deploy job, three predictions, a model rebuild, and then three more predictions. They hit run and go to sleep. When they wake up for work in the morning, they are happy to see that all 9 jobs have ran successfully, and they are able to view their results in SensibleAI Forecast.

Routine Methods

1. Init (Constructor)
  • Method: __init__
    • Type: Constructor

    • Allow In-Memory Execution: No

    • Read Only: No

    • Method Limits: There are no limits for the constructor method of the Prediction Simulator Routine.

    • Outputs Dynamic Artifacts: No

    • Short Description:

      • Initialize the Prediction Simulator Routine.
    • Detailed Description:

      • Initializes the project connection and simulation state for the Prediction Simulator Routine.
    • Inputs:

      • Required Input
        • Project Connection: The name of the project to connect to (Note: You MUST have a FOR project ran at least through the Dataload step to make a selection).
          • Name: project_id
          • Tooltip:
            • Validation Constraints:
              • This input may be subject to other validation constraints at runtime.
          • Type: int
    • Artifacts: No artifacts are returned by this method

2. Set Datasources (Method)
  • Method: set_datasources
    • Type: Method

    • Memory Capacity: 2.0 GB

    • Allow In-Memory Execution: No

    • Read Only: No

    • Method Limits: There are no known limits for this method. Datasource connections are created and updated for the simulator project.

    • Outputs Dynamic Artifacts: No

    • Short Description:

      • Set the datasources for the prediction simulator routine.
    • Detailed Description:

      • This method sets the datasources with the provided target and feature data definitions. These datasources will be stored for simulator use with the associated routine instance and overwrite the current datasources of the connected project.
    • Inputs:

      • Required Input
        • Source Data Definition: The source data definition to use. Must be the same number of datasets as specified in Dataload.
          • Name: source_data_definition
          • Tooltip:
            • Validation Constraints:
              • This input may be subject to other validation constraints at runtime.
          • Type: Must be an instance of Target Data Source Configuration
          • Nested Model: Target Data Source Configuration
            • Required Input
              • Source Data Connection Type: The connection type to use to access the source data.
                • Name: tabular_connection
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: Must be one of the following
                  • Sql Server Data Source
                    • Required Input
                      • Database Resource: The database resource to connect to, this is also known as the server name.
                        • Name: database_resource
                        • Tooltip:
                          • Validation Constraints:
                            • This input may be subject to other validation constraints at runtime.
                        • Type: str
                      • Database Schema: The database schema to connect to, this is also known as the database name.
                        • Name: database_schema
                        • Tooltip:
                          • Validation Constraints:
                            • This input may be subject to other validation constraints at runtime.
                        • Type: str
                      • Tables: The table(s) from the database to connect to.
                        • Name: tables
                        • Tooltip:
                          • Validation Constraints:
                            • The input must have a minimum length of 1.
                            • This input may be subject to other validation constraints at runtime.
                        • Type: list[str]
                  • File Data Source
                    • Required Input
                      • File Path: The full file path to the file to ingest.
                        • Name: file_paths
                        • Tooltip:
                          • Validation Constraints:
                            • The input must have a minimum length of 1.
                            • This input may be subject to other validation constraints at runtime.
                        • Type: list[str]
              • Intersection Dimensions: The target intersection dimensions.
                • Name: intersection_dimensions
                • Tooltip:
                  • Validation Constraints:
                    • The input must have a minimum length of 1.
                    • This input may be subject to other validation constraints at runtime.
                • Type: list[str]
              • Date Column: The date column.
                • Name: date
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: str
              • Value Column: The value column.
                • Name: value
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: str
            • Optional Input
              • Location Column: The optional location column.
                • Name: location
                • Tooltip:
                  • Validation Constraints:
                    • This input may be subject to other validation constraints at runtime.
                • Type: Optional[str]
        • Feature Data Definition: The feature data definition to use. Must be the same number of datasets as specified in Dataload.
          • Name: feature_data_definitions
          • Tooltip:
            • Validation Constraints:
              • This input may be subject to other validation constraints at runtime.
          • Type: list[FORDataSourceTargetCommit]
    • Artifacts: No artifacts are returned by this method

3. Simulator (Method)
  • Method: simulator
    • Type: Method

    • Memory Capacity: 2.0 GB

    • Allow In-Memory Execution: No

    • Read Only: No

    • Method Limits: The duration and compute required for this method are very dependent on the project configurations and work units provided as inputs. Execution times are directly comparable to SensibleAI Forecast jobs. This method may take anywhere from a few minutes to many hours to complete. Standard FOR configuration limits apply.

    • Outputs Dynamic Artifacts: No

    • Short Description:

      • Simulate a list of tasks on a project
    • Detailed Description:

      • Runs the job(s) specified in the input parameters in the order in which they were specified.
    • Inputs:

      • Required Input
        • Work Units: The jobs to run against the project. Ran in the order they are specified.
          • Name: work_units
          • Tooltip:
            • Validation Constraints:
              • The input must have a minimum length of 1.
              • This input may be subject to other validation constraints at runtime.
          • Type: list[WorkUnit]
    • Artifacts: No artifacts are returned by this method

Interface Definitions

No interface definitions found for this routine

Developer Docs

Routine Typename: PredictionSimulator

Method NameArtifact Keys
__init__N/A
set_datasourcesN/A
simulatorN/A

Was this page helpful?