Icon

Regression Model Evaluation using Giskard

<p>This workflow uses the <strong>Giskard Scanner node</strong> to scan a machine-learning workflow for common weaknesses.</p><p>The idea of the Giskard Scanner node is to allow <strong>fine-tuning of your ML model while developing</strong> it in KNIME Analytics Platform. Hence, the example mimics a data scientist's different attempts and modifications to their models and workflows before putting them into production.</p><p>It is also possible to use Giskard after the model is deployed in production. Workflow monitoring using Giskard allows the data scientist to be aware of issues with production data flowing into the model, such as data shift phenomena.</p><p>You can download and run the workflow directly in your KNIME Analytics Platform. We recommend using the latest version of KNIME AP for optimal performance.</p><p>The goal of the model is to predict the price of different vehicle models.</p><p></p><p>Workflow Steps</p><ol><li><p><strong>Reading the Data</strong></p><ul><li><p>The data is embedded into the workflow, so you can just execute the node.</p></li></ul></li><li><p><strong>Partitioning into Train and Test</strong></p><ul><li><p>The partitioning node splits the data into 70% training and 30% test data, which is used later to evaluate the model with Giskard.</p></li></ul></li><li><p><strong>Fine-Tuning ML Models Attempts</strong></p><ul><li><p>The workflow represents two moments of fine-tuning ML models to make clear how to use Giskard while developing your ML workflow in KNIME.</p></li></ul></li></ol><p>Attempt 1</p><ol><li><p><strong>Model Training</strong></p><ul><li><p>Train a Gradient Boost Trees regression model on the dataset using Price as the target column and all the predictors.</p></li></ul></li><li><p><strong>Capture Inference Workflow</strong></p><ul><li><p>The inference workflow is surrounded by the Capture Workflow Start and End nodes that extract the contained workflow snippet into a dedicated workflow port object.</p></li><li><p>The inference workflow uses the model predictor to create the classification output. In addition to the predicted class, the predictor outputs the class probabilities, which Giskard uses.</p></li></ul></li><li><p><strong>Evaluate Inference Workflow with Giskard</strong></p><ul><li><p>The Giskard Scanner node checks the inference workflow for common weaknesses in robustness, spurious correlation, performance, and overconfidence categories. Please refer to the workflow annotations for further details about this attempt's findings.</p></li></ul></li></ol><p>Final Attempt</p><ol><li><p><strong>Model Training</strong></p><ul><li><p>Train a Gradient Boost Trees regression model on the dataset using Price as the target column. Based on previous attempt learning, we exclude the variables model, condition, and color.</p></li></ul></li><li><p><strong>Capture Inference Workflow</strong></p><ul><li><p>The captured workflow part now includes some <strong>preprocessing operations</strong> to handle perturbation in the nominal predictors. The inference workflow applies the preprocessing operations followed by the model predictor to create the classification output. In addition to the predicted class, the predictor also outputs the class probabilities, which are used by Giskard.</p></li></ul></li><li><p><strong>Evaluate Inference Workflow with Giskard</strong></p><ul><li><p>Please refer to the workflow annotations for further details.</p></li></ul></li></ol><p>This workflow demonstrates how to fine-tune and evaluate ML models using the Giskard Scanner node in KNIME, ensuring robust and reliable models before deployment.</p>

Impact of Input Data Variations on Model Performance

Takeaways

  • The model shows major performance and robustness issues

  • Giskard Report: The sensitivity of certain variables to perturbations can lead to prediction instability

Increasing model performance and robustness

Takeaways

  • By excluding some variables from the input data, we can get a more accurate estimation (model, condition, color) are too sparse

  • With a string manipulation, we wrote a function to handle perturbation in the nominal predictors

  • The number of issues reported by Giskard significantly dropped

Regression Model Evaluation using Giskard

  • This workflow aims to showcase the capabilities of the Giskard Scanner node to scan ML workflows for common weaknesses.

  • The example illustrates how to fine-tune a model after one attempt before putting it into production using Giskard Scanner nodes.

  • To learn more about the workflow, click the left bar and check the description section.

Capture Workflow Start
Vehicles dataset
CSV Reader
Capture Workflow End
trainingand test
Partitioning
Solved 75% of the issues
Giskard Scanner
Capture Workflow End
Multiple issues related to Robustness and Performance
Giskard Scanner
Gradient Boosted Trees Predictor (Regression)
Model with all predictors
Gradient Boosted Trees Learner (Regression)
R Squared: 44%
Numeric Scorer
Gradient Boosted Trees Predictor (Regression)
Gradient Boosted Trees Learner (Regression)
Capture Workflow Start
R Squared: 78%
Numeric Scorer
Domain Calculator
correct perturbations in the input data
String Manipulation (Multi Column)
correct perturbations in the input data
String Manipulation (Multi Column)

Nodes

Extensions

Links