Skip to main content

PredictionSimulator

Versions​

v2.0.0​

Basic Information​

Class Name: PredictionSimulator

Title: Prediction Simulator

Version: 2.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 updated target and feature source data for a given project, and the routine will reuse the project's existing dataform configuration while updating source data based on dates the user provides for respective job types. 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, they can use the Prediction Simulator routine to run those jobs in sequence overnight, unattended. 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 run successfully, and they are able to view their results in SensibleAI Forecast.

Routine Methods​

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

    • Memory Capacity: 2.0 GB

    • Allow In-Memory Execution: Yes

    • 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. This constructor supports in-memory execution so Studio can initialize routine instances without dispatching to Conduit. Datasource data is not loaded here; it is materialized later by set_datasources or simulator when needed.
    • Inputs:

      • Required Input
        • Project Connection: The name of the project to connect to (Note: You MUST have a FOR project run 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: Upload updated target source data. The connected project's existing target dataform configuration will be reused.
          • Name: source_data_definition
          • Tooltip:
            • Validation Constraints:
              • This input may be subject to other validation constraints at runtime.
          • Type: SimulatorTargetDataUpload
        • Feature Data Definition: Optional feature data uploads. Select an existing project feature datasource and provide updated data. Any feature datasources not uploaded will use the existing project data.
          • Name: feature_data_definitions
          • Tooltip:
            • Validation Constraints:
              • This input may be subject to other validation constraints at runtime.
          • Type: list[SimulatorFeatureDataUpload]
    • 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. Run 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?