Create Forecasting Models in DS Lab
Workflow 2 in DS Lab demonstrates the power and simplicity of creating and optimizing forecasting models by leveraging in-built algorithms, boilerplate code, and utility/artifact features.
Purpose
This guide explains how to create and compare forecasting models in the BDB DS Lab using the platform’s in-built algorithms, boilerplate code, and artifact utilities. The workflow demonstrates two forecasting approaches—N-BEATS and Random Forest—while leveraging utility scripts and artifacts for efficient experimentation.
Objectives
By completing this workflow, you will learn how to:
Create and configure a DS Lab project.
Upload and use a utility script.
Build a forecasting model using the N-BEATS algorithm.
Save a pre-processed DataFrame as an artifact for reuse.
Build another forecasting model using the Random Forest algorithm based on the artifact data.
Step 1 – Create a New DS Lab Project
From the Apps menu, open DS Lab.
Click Create +.
Enter the following details:
FieldExampleNotesProject Name
DS LAB WORKFLOW 2Descriptive and unique
Description
“Forecasting Model Workflow”
Optional
Algorithm Type
Forecasting
(Other options – Regression, Classification, NLP)
Environment
Python TensorFlow
Selected for this workflow
Resource Allocation
Low
Adjust based on dataset size
Idle Shutdown
30 minutes
Auto-terminates inactive sessions
Add external libraries if required (for example,
boto3).Click Save.

Activate the project using the Activate button on the right panel.
Once activated, click View to open it and wait for the kernel to start.
Step 2 – Upload a Utility Script
In the project interface, navigate to the Utils tab.
Click the three-dot menu (⋮) and select Import.
Enter a name —
utility_func.Browse your local system and select the required utility Python file.
Click Save.

Step 3 – Create a Notebook and Upload a Dataset
Ensure the project kernel is active.
Click Create Notebook, provide:
Notebook Name:
DS Lab Workflow 2Description: “Forecasting Model Development”
Click Save.
Click the Data icon on the left navigation bar.
Click the + Add Data icon on the upper-right.
On the Add Data page:
Select Data Sandbox Files as the data source.
Click Upload, provide a name (e.g., Forecasting Data), description, and choose the CSV file from your local machine.
After upload, a pop-up confirms “File is uploaded.”
Check the box beside the uploaded sandbox and click Add.
A code snippet automatically appears in the notebook cell to load the dataset.
Click Run Cell to execute.
Step 4 – Import the Utility Script
In a new cell, write Python code to import the uploaded utility file.

Run the cell to verify successful import and to load any custom functions required for preprocessing.
Step 5 – Create a Forecasting Model Using N-BEATS
From the left-hand menu, select the Algorithm tab.
Choose Forecasting → N-BEATS.
Ensure the target cell is selected before the algorithm is chosen.
The system will auto-generate boilerplate code for N-BEATS forecasting.
Update the key parameters:
_data = 'df' _time = 'date' _target = 'sale'Run the cell to train the model.
Visualize the results:
Use
matplotlibto display actual vs. predicted sales.Use
modelname.predict()for additional forecasting scenarios.
Step 6 – Save the Preprocessed Data as an Artifact
Insert a new cell below the import-utility cell.
Open the cell menu (⋮) and select Save Artifact.
The system generates boilerplate code automatically.
Configure the artifact:
artifact_df = df_preprocessed artifact_name = "forecasting_artifact.csv"Run the cell to save the artifact.
Open the Artifacts tab on the left to confirm creation.
Step 7 – Create a Forecasting Model Using Artifact Data
7.1 Create a New Notebook
Click Create Notebook, name it
Test Artifacts and Random Forest Algorithm.Provide a brief description and click Save.
7.2 Load Artifact Data
Click the Data icon → + Add Data.
Select Data Sandbox Files as the source.
Upload or reference the same artifact file saved earlier.
Check its box and click Add.
Run the automatically generated code cell to load the artifact dataset.
7.3 Build a Random Forest Forecasting Model
From the Algorithm tab, select Forecasting → Random Forest.
Ensure the notebook cell is selected before generating code.
Modify the generated script as follows:
_data = 'df_preprocess_dataframe' _time = 'date' _target = 'sale'Run the cell to train and evaluate the Random Forest forecasting model.
Step 8 – Validate Results and Clean Up
Compare prediction accuracy and graphs from both algorithms (N-BEATS vs. Random Forest).
Save results or metrics as needed.
Deactivate the project to release compute resources.
Outcome
You have successfully:
Created a forecasting project in DS Lab.
Utilized the N-BEATS algorithm for time-series prediction.
Saved a processed DataFrame as an artifact.
Reused artifact data to build a Random Forest forecasting model.