Enhancing predictive modeling with customized visualization

Product: pSeven Enterprise

February 3, 2026

Introduction

Complex engineering workflows often require a seamless transition between automated process execution and interactive results analysis. It is often the case when engineers design complex workflows in one environment, execute them, and then switch to external tools to visualize or refine the results. These interruptions can reduce productivity and disrupt data traceability.

In the latest release, pSeven Enterprise now provides a unified environment for exploring data and inspecting predictive models directly within the interface. This allows users to interactively post-process execution results and build customized reports. This feature bridges the gap between workflow-based model development and interactive analytics.

To demonstrate this integrated approach, we will walk through a complete example based on the rotor disk optimization problem, aimed at finding the optimal rotor geometry that minimizes mass while satisfying constraints on maximum stress and displacement.

We begin with a predictive model that was already trained using the Model Builder block. This model predicts mass, maximum stress, and displacement for a vector of geometric parameters. We will use a new 25-point sample generated from the disk computational model to update the initial model. Additionally, we have a 50-point test sample for model validation.

1. Initial model inspection and training sample analysis

We can inspect our initial model by double-clicking it in the File explorer. The Model explorer window opens automatically (see Figure 1), giving us instant access to:

  • Input/output definitions, technique, training time and other metadata.
  • 1D response slices showing how each output responds to individual inputs.
  • Validation errors on training sample and internal validation results.

Initial model preview window

Fig 1. Initial model preview window

Inspecting the preview, particularly the plot in Figure 2, reveals a warning sign: while the training error appears small, the internal validation indicates a poor fit. Internal validation simulates how the model performs on unseen data by holding back parts of the training set during the building process. Ideally, all points should lie along the diagonal "Perfect fit" line, where the predicted value equals the actual value. The scatter we see indicates that the model, although fitting the training data well (overfitting), cannot generalize to new points.

Initial model errors on internal validation sample

Fig 2. Initial model errors on internal validation sample

This leads us to the next section, where we will try to improve the accuracy of our predictions by training a new model.

To improve prediction accuracy, we will train a new model using the initial one, as a starting point, along with our training sample. We begin by inspecting the training sample. Double-click the file (or press Space with it selected) to open the preview, as shown in Figure 3.

Inspecting the initial sample with the preview window

Fig 3. Inspecting the initial sample with the preview window

The preview window offers five tabs: Table, Statistics, Plots, Correlations, and Dependencies. The Correlations tab shows relationships between all features, while Dependencies shows how inputs affect outputs.

By default, the preview treats only the last CSV column as an output. However, our rotor disk problem has multiple outputs: mass, max stress, max displacement. To analyze dependencies for all outputs, we will export this preview to a customizable notebook and modify it to include additional outputs.

To do this, click the “Export notebook” button in the preview window and select the save location. In this example, we use the default folder and name the notebook. It opens in a new tab, as shown in Figure 4.

Tab of notebook exported from training sample preview

Fig 4. Tab of notebook exported from training sample preview

The first cell of the dependencies section shows that the linear technique is selected, and only 'Max stress' is included in the output columns list.

# Dependencies settings
technique = "linear" # linear | quadratic
output_columns = ["Max stress"]

We can define more output columns to visualize all targets at once. Additionally, we change the dependency analysis technique from "linear" to "quadratic". This allows the plots to capture curved, non-linear relationships between inputs and outputs, which are common in engineering problems. Click the edit button in the top left of the tab and update the cell's code as follows:

# Dependencies settings
technique = "quadratic"
output_columns = ["Mass", "Max displacement", "Max stress"]

After running the notebook by pressing the run button, we can explore the results. The plots in the dependency section now display an analysis considering all outputs, as shown in Figure 5a.

Results of customizing the dataset preview via a notebook

Fig 5a. Results of customizing the dataset preview via a notebook

Figures 5b and 5c compare the original and customized dependency analysis plots.

Dependency analysis before customizing the dataset preview via a notebook

Fig 5b. Dependency analysis before customizing the dataset preview via a notebook

Dependency analysis after customizing the dataset preview via a notebook

Fig 5c. Dependency analysis after customizing the dataset preview via a notebook

2. Training a new model with Model builder block

We will now use the Model builder block to train a new model based on the initial model and the training sample. Create a new workflow and add the Model builder block from the block library. We will use the Model builder SmartSelection feature. Instead of forcing a specific technique, SmartSelection tests multiple techniques and automatically picks the one that best fits our data and accuracy requirements.

Open the block's GUI and load the training sample directly into the interface. Input and output columns are detected automatically and can be adjusted if needed (Figure 6). This eliminates the need to manually configure each variable.

Training sample tab of Model builder GUI. Input and output columns populate automatically, saving configuration time

Fig 6. Training sample tab of Model builder GUI. Input and output columns populate automatically, saving configuration time

Navigate to the “Initial model” tab (Figure 7) and select the initial model file. Once loaded, the model's details appear in the collapsible sections of the tab.

Initial model tab of Model builder block GUI with detailed information of loaded model

Fig 7. Initial model tab of Model builder block GUI with detailed information of loaded model

Next, move to the “SmartSelection” tab (Figure 8). Here, we can control the techniques available to the builder, set accuracy requirements, and configure validation and training settings. We keep all available techniques enabled, allowing the algorithm to find the best combination. Load the test sample into the validation settings field. This allows the builder to use this separate dataset to tune the model's internal settings (hyperparameters), ensuring it performs well on data it wasn't explicitly trained on.

SmartSelection tab of Model builder GUI with some custom settings defined

Fig 8. SmartSelection tab of Model builder GUI with some custom settings defined

In the “Results” tab, set the model’s name to “updated” and provide a description (Figure 9).

Results tab of Model builder GUI

Fig 9. Results tab of Model builder GUI

Run the workflow to train the model. The result is saved a model file in the run results (Figure 10).

Updated model in the workflow run results

Fig 10. Updated model in the workflow run results

Inspect the new model using the preview, just as we did for the training sample and initial model (Figures 11 and 12).

Preview of the updated model showing techniques selected by SmartSelection and improved validation metrics

Fig 11. Preview of the updated model showing techniques selected by SmartSelection and improved validation metrics

Updated model errors on internal validation sample

Fig 12. Updated model errors on internal validation sample

SmartSelection chose distinct techniques for each output: MoA (Mixture of Approximators) for Mass and Max displacement, and GBRT (Gradient Boosted Regression Trees) for Max stress. The internal validation score improved significantly compared to the initial model (R2 of 0.89 vs. 0.44). This suggests better generalization to new data.

Having trained a new model that should predict our target functions more accurately, we can verify this by comparing both models against the test sample.

3. Custom notebook for model comparison and validation

To compare both models side-by-side, we create a custom validation notebook. While we exported the preview into a notebook for the training sample, we will create this notebook from scratch.

Select the “New notebook” option in the explorer menu. This opens a dialog (Figure 13) where we can choose the folder for the notebook, select a template, or set a working file - a file the notebook can access.

Dialog to create a new notebook. We can select the name, location, template, and working file

Fig 13. Dialog to create a new notebook. We can select the name, location, template, and working file

Replace the example code with the following validation code. This code loads the models and calculates and displays the prediction errors on the test sample, leveraging the `.validate()` method in pSeven Core, an embedded, proprietary Python library of algorithms, including those for building predictive models. In the file header, we specify a list of relative paths to the files our notebook works with in YAML format.

                    # ---
                    # jupyter:
                    # .p7:
                    # files: # names or relative paths to files that your notebook opens
                    # - ./Home.Model builder/updated.p7model
                    # - ./initial.p7model
                    # - ./test.csv
                    # require: '@python3_10:local' # only change if using a custom Python environment
                    # ---
                    
                    # %% jupyter={"source_hidden": true}
                    # Load sample and models
                    import da.p7core
                    import matplotlib.pyplot as plt
                    import pandas as pd
                    
                    # Read the test dataset from CSV
                    test_sample = pd.read_csv("./test.csv")
                    # Separate input features (X) and target outputs (Y)
                    test_x = test_sample
                    test_y = test_sample test_sample.describe()
                    
                    # %% jupyter={"source_hidden": true}
                    # Determination coefficients
                    
                    # Load the trained models from .p7model files
                    initial_model = da.p7core.gtapprox.Model("./initial.p7model")
                    updated_model = da.p7core.gtapprox.Model("./Home.Model builder/updated.p7model")
                    
                    # Calculate R^2 (coefficient of determination) for both models on the test set
                    initial_r2 = initial_model.validate(test_x, test_y)["R^2"]
                    updated_r2 = updated_model.validate(test_x, test_y)["R^2"]
                    
                    # Create a comparison table of R^2 scores
                    initial_df = pd.DataFrame(initial_r2, index=test_y.columns, columns=["Initial R^2"])
                    updated_df = pd.DataFrame(updated_r2, index=test_y.columns, columns=["Updated R^2"])
                    pd.concat([initial_df, updated_df], axis=1).T
                    
                    # %% jupyter={"source_hidden": true}
                    # Truth vs. Prediction plots
                    
                    # Generate predictions for the test inputs
                    initial_model_y = initial_model.calc(test_x)
                    updated_model_y = updated_model.calc(test_x)
                    
                    # Create a subplot for each output variable
                    fig, axes = plt.subplots(1, len(test_y.columns), figsize=(16, 4))
                    for i, output in enumerate(test_y):
                    output_min = test_y[output].min()
                    # Plot the "Perfect fit" diagonal line
                    axes[i].axline(xy1=(output_min, output_min), slope=1, color='grey')
                    # Scatter plot for Initial model predictions
                    axes[i].scatter(test_y[output], initial_model_y[output], label='Initial model')
                    # Scatter plot for Updated model predictions
                    axes[i].scatter(test_y[output], updated_model_y[output], label='Updated model')
                    axes[i].set_title(output)
                    axes[i].set_xlabel('Truth')
                    axes[i].set_ylabel('Prediction')
                    axes[i].legend()
                    axes[i].grid()
                    plt.show()
                

We run the validation notebook to view the prediction errors (Figure 14). The tables confirm that the improved model has a much smaller prediction error on the test sample than the initial one. We can also verify this visually in the truth vs. prediction scatter plots, where the improved model's points are generally closer to the diagonal line indicating better fit.

Validation of the two models against the test sample

Fig 14. Validation of the two models against the test sample

This comparison highlights the notebook as a traceable validation layer: test-set evaluation provides a direct measure of generalization to unseen data, and embedding it in a notebook makes the validation process explicit, reproducible, and tied to the exact models and datasets under evaluation.

Conclusion

In this tech tip, we demonstrated the synergy between automated workflows and interactive notebooks in pSeven Enterprise. We started by diagnosing an initial model using built-in previews and performing advanced analysis on the training data by customizing an exported notebook. Next, we configured the Model builder block to train a more accurate model. Finally, we validated the performance gains by comparing the initial and updated models side-by-side in a custom notebook. This integrated approach combines the automation of workflows with the flexibility of interactive notebooks, ensuring that every step of the model development lifecycle - from data inspection to final validation - is transparent, reproducible, and efficient.

Interested in the solution?

Click to request a free trial version or demo access.

Get a free trial