https://kedro.org/ logo
#questions
Title
# questions
f

Francis Duval

02/02/2024, 3:48 PM
Hello you'all! Let's say I compute the R2 score for many models, just like in this example: https://demo.kedro.org/?pipeline_id=__default__&selected_id=495a0bbc. Each model has its own namespace. Now suppose I have many more models, for instance, 20 of them. What if I want to create in my pipeline a dataset which is a CSV file having 2 columns: the name of the model and the R2 score? In other words, how do I compile the results coming from multiple namespaces? I could do something like:
Copy code
def compile_results():
  # Takes the name of R2 score datasets and returns a table with model_name and R2_score

node(
  func=compile_results
  inputs=[
    'train_evaluation.linear_regression.r2_score',
    'train_evaluation.random_forest.r2_score',
    etc.
  ],
  outputs='results_table'
)
Is there a better way to do this? If I have many more models, it can become cumbersome to write all the inputs.